我正在使用以下测试代码尝试创建菱形类型形状。跨度为一个标准的长方形,及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>