CSS仿真模拟小箭头的完成编码

2021-03-12 02:30 jianzhan

图:

HTML编码:

拷贝编码
编码以下:

<div class="pre-wrap">
<div class="pre">
<div class="pre1"></div>
<div class="pre2"></div>
</div>
</div>

CSS编码:

拷贝编码
编码以下:

.pre-wrap {
width: 200px;
height: 120px;
margin: 50px auto 0;
border: 2px solid #F00;
border-radius: 4px;
position: relative;
}
.pre {
width: 80px;
height: 80px;
position: absolute;
top: 20px;
left: 40px;
}
.pre1 {
border-width: 40px;
border-color: transparent #F30 transparent transparent;
}
.pre2 {
border-width: 40px;
border-color: transparent #FFF transparent transparent;
position: relative;
top: ⑻0px;
left: 15px;
}
.pre1, .pre2 {
/*****设定border-style:dashed;使ie6适用border全透明*****/
border-style: dashed solid dashed dashed;
/*****设定器皿宽高为0*****/
width: 0;
height: 0;
/*****去掉ie6下默认设置高宽比,设定下列特性*****/
line-height: 0;
font-size: 0;
overflow: hidden;
}