css 画三角形

<div class="tips"></div>

.tips{

position: relative;

border: 1px solid #aaa;

}

.tips:before{

content: "";
position: absolute;
border-style: solid;
/* reduce the damage in FF3.0 */
display: block;
width: 0;
top: -7px; /* value = - border-top-width - border-bottom-width */
left: 28px; /* controls horizontal position */
bottom: auto;
border-width: 0 9px 7px; /* vary these values to change the angle of the vertex */
border-color: #666 transparent;

}

.tips:after{

content: "";
position: absolute;
border-style: solid;
/* reduce the damage in FF3.0 */
display: block;
width: 0;
top: -5px; /* value = - border-top-width - border-bottom-width */
left: 30px; /* controls horizontal position */
bottom: auto;
border-width: 0 7px 5px; /* vary these values to change the angle of the vertex */
border-color: #fff transparent;

}

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。