我想創建一個在正常和傾斜的內容底部具有邊緣的div或節。結果應該是這樣的: http://themeforest.net/item/delicious-responsive-app-landing-html-theme/full_screen_preview/7965552 有人可以幫助我嗎?創建一個具有斜邊的div(Html,Css)
-2
A
回答
0
您給出的示例使用具有透明背景的圖像。
這是可能的CSS。
HTML:
<div></div>
CSS:
div {
height:200px;
width:1000px;
background:indianred;
margin-top:250px;
position:relative;
}
div::before {
content:'';
position:absolute;
width: 0;
height: 0;
border-bottom: 100px solid indianred;
border-left: 1000px solid transparent;
top:-100px;
}
div::after {
content:'';
position:absolute;
width: 0;
height: 0;
border-top: 100px solid indianred;
border-right: 1000px solid transparent;
bottom:-100px;
}
如果你想瀏覽器的兼容性,你必須堅持與圖像的方法。
0
你可以使用一個後臺招:
<div class="div1">
content 1
</div>
<div> content 2</div>
.div1 {
background: linear-gradient(352deg, transparent 125px, #c00 0) bottom right;}
+0
改編自這個問題:http://stackoverflow.com/questions/10349867/how-do-i-bevel-the-corners-of-an-element – Luciano
相關問題
- 1. 爲div創建一個傾斜的邊
- 2. 創建一個DIV + CSS
- 3. 歪斜的邊框上一個div
- 4. 如何在CSS中創建帶有邊框的傾斜標籤?
- 5. HTML/CSS - 在DIV的一側創建一個「箭頭」
- 6. 矩形有一個斜邊
- 7. 如何爲div創建一個css邊界
- 8. CSS創建一個透明的div
- 9. css blueprint,創建一個浮動在容器div旁邊的div?圖像連接
- 10. 在CSS/HTML創建六邊形
- 11. HTML/CSS創建三欄邊框陰影
- 12. 創建具有邊框的居中div圖像的蒙版
- 13. Python3:創建具有在反斜槓
- 14. 3具有溢出內容到下一個DIV浮動的div - HTML和CSS
- 15. 如何創建CSS圖像與傾斜的邊框
- 16. html/css:在div中創建洞
- 17. CSS:創建具有邊界半徑的時鐘
- 18. CSS - 沒有填充的斜邊
- 19. 在中心創建5個具有1個DIV的DIV
- 20. 半傾斜的div邊框
- 21. CSS嶺邊境的一個div
- 22. 創建HTML DIV
- 23. Javascript,html和css創建一個覆蓋
- 24. HTML/CSS:如何獲得具有單個邊框的框?
- 25. 漸變幫助創建一個傾斜的div
- 26. 如何創建一個側面傾斜的div
- 27. 傾斜的邊界與CSS?
- 28. 如何創建一個具有表單的div?
- 29. 如何創建一個邊框,將輪廓div減去邊距
- 30. 如何在WPF中創建一個斜切漸變邊框
我們需要你有有效回答的代碼。 –