-1
A
回答
7
CSS只解決方案使用border
:
.block {
background-color: #f3f3f3;
color: #909090;
font-family: Arial, sans-serif;
margin: 0 auto;
padding: 20px 20px 10px;
width: 300px;
}
.block h2 {
background-color: #a9c4c6;
color: white;
font-family: Roboto Slab, serif;
font-weight: normal;
position: relative;
left: -29px;
margin: 0;
position: relative;
text-indent: 29px;
text-transform: uppercase;
}
.block h2:before {
content: "";
display: block;
position: absolute;
top: -8px;
left: 0;
border-width: 4px 5px;
border-color: #84a0a2;
border-style: solid;
border-top-color: transparent;
border-left-color: transparent;
width: 0;
height: 0;
}
<link href="https://fonts.googleapis.com/css?family=Roboto+Slab" rel="stylesheet">
<section class="block">
<h2>Furniture</h2>
<p>Should I make this object from pure CSS if it is possible or us it as a background image for a div?</p>
<p>It goes outside of main content area so I am not sure how to implement it. I guess I should use absolute positioning for the div?</p>
</section>
+0
不錯......看起來不錯。 –
0
我們有一個CSS邊界工作,我們得到相同的....
欲瞭解更多,你必須閱讀像這樣的文章你如何使用CSS形狀https://css-tricks.com/examples/ShapesOfCSS/。
.main{
padding:20px;
}
.test {
font-size: 15px;
background: #ccc;
padding:10px
}
h2
{
\t position: relative;
\t width: 50%;
\t font-size: 1.5em;
\t font-weight: bold;
\t padding: 6px 20px 6px 70px;
\t color: #555;
\t background-color: #AECACC;
\t text-shadow: 0px 1px 2px #bbb;
\t -webkit-box-shadow: 0px 2px 4px #888;
\t -moz-box-shadow: 0px 2px 4px #888;
\t box-shadow: 0px 2px 4px #888;
left:-20px;
}
h2:after
{
\t content: ' ';
\t position: absolute;
/*EDIT border WIDTH as you want fold tringle with css */
\t border-bottom: 10px solid #8BA8AA;
border-left: 10px solid transparent;
height: 0;
width: 0;
left: 0px;
/*EDIT TOP as border width */
\t top: -10px;
}
<div class="main">
<div class="test">
<h2>HEADING HERE</h2>
</div>
</div>
相關問題
- 1. 將PSD轉換爲網站
- 2. 如何將此PHP數組對象轉換爲json?
- 3. 如何將此JSON對象轉換爲字符串數組?
- 4. 如何將此對象轉換爲JavaScript中的數組?
- 5. 如何將此字符串轉換爲JSON對象?
- 6. 如何將Python對象轉換爲XML?
- 7. 如何將Scripting.Dictionary轉換爲JavaScript對象?
- 8. 如何將對象轉換爲數組?
- 9. 如何將JSON轉換爲對象?
- 10. 如何將對象轉換爲int?
- 11. 如何將pd.to_timedelta()轉換爲time()對象?
- 12. 如何將JSON轉換爲對象
- 13. 如何將JSONString轉換爲Javascript對象
- 14. 如何將i18n.map轉換爲json對象
- 15. 如何將json轉換爲對象?
- 16. Java將對象轉換爲Class如何?
- 17. 如何將NSDictionary轉換爲JSON對象?
- 18. 如何將對象轉換爲InputStream
- 19. 如何將HttpRequest轉換爲HttpRequestBase對象?
- 20. 如何將樹轉換爲JSON對象?
- 21. 如何將php對象轉換爲javascript?
- 22. 如何將對象轉換爲標題
- 23. 如何將指針轉換爲對象?
- 24. 如何將java.sql.Date對象轉換爲GregorianCalendar?
- 25. 如何將JSONObject轉換爲類對象?
- 26. 如何將對象轉換爲泛型?
- 27. 如何將DTO轉換爲域對象
- 28. 如何將JSON對象轉換爲servlet?
- 29. PSD轉換爲html格式
- 30. 如何將對象的對象轉換爲對象數組?
我相信這是更好地使用背景圖片。 –
這很容易使用CSS來完成。 – connexo
@connexo您的專業知識可能會說。你想回答嗎,因爲我也對此感興趣。 ':)' –