css 三角形
2018-01-24 本文已影响0人
JamHsiao_aaa4
#demo {
width: 100px;
height: 100px;
background-color: #333;
position: relative;
}
#demo:after {
border: solid transparent;
border-left-color: #333;
border-width: 10px;
width: 0;
content: " ";
position: absolute;
left: 100%;
top: 10%;
}
#demo:before{
border: solid transparent;
border-right-color: red;
border-width: 10px;
width: 0px;
content: " ";
position: absolute;
right: 100%;
top: 70%;
}