我正在使用以下測試代碼嘗試創建菱形類型形狀。跨度爲一個標準的長方形,及2面會使似乎沒有任何渲染之前和選擇後,出現一個菱形使用背景圖像製作菱形形狀
**********
* *
******
然而,。我不確定我是否做錯了,或者如果我完全擺脫了他們的位置,我會更好。
任何想法?
<style>
span {
width:50px;
height:20px;
color:white;
background-color:red;
padding:10px;
}
span:before {
background: url('left_side.png') left center no-repeat;
height:43px; width:22px;
}
span:after {
background: url('right_side.png') right center no-repeat;
height:43px; width:22px;
}
</style>
<html>
<body>
<span>
Some text goes here
</span>
</body>
</html>