http://caibaojian.com/css-border-triangle.html
.text{
height:0;
width:0;
/* 这里设置overflow, font-size, line-height,是因为,
* 虽然宽高度为0, 但在IE6下会具有默认的字体大小和行高,
* 导致盒子呈现被撑开的长矩形*/
overflow: hidden;
font-size:0;
line-height:0;
border-color:#FF9600 transparent transparent transparent;/*IE6不支持transparent属性*/
border-style: solid dashed dashed dashed;//
IE6下, 设置余下三条边的border-style为dashed,即可达到透明的效果~,但在火狐下会出现只有半边三角形效果border-width:20px;
}
最终效果:
.switchCity .chose {
float: left;
width:100%;
padding:24px0024px;
position: relative;
}
.switchCity .chose p {
float: left;
padding:10px;
background:#8FAB72;
border-radius:1px;
}
.switchCity .chose span {
position: absolute;
left:0;
top:0;
height:0;
width:0;
overflow: hidden;
font-size:0;
line-height:0;
border-color:#8FAB72 transparent transparent transparent;
border-style:solid!important;/单独解决IE7和火狐Bug/
border-style:solid dashed dashed dashed;
border-width:11px11px0;
}