【发布时间】:2017-03-05 23:17:07
【问题描述】:
我想用底部透明三角形编写新闻的 div 边框,但左三角边框不等于右,你能解释一下原因或让我知道其他编码方式吗?
我的代码:
.news {
position: relative;
margin: 75px auto;
width: 200px;
border: 1px #079199 solid;
padding: 20px;
color: #bcbcbc;
word-wrap: break-word;
}
.news:after {
position: absolute;
content: '';
border: 25px solid transparent;
border-top-color: #FFF;
top: 100%;
left: 50%;
}
.news:before {
position: absolute;
content: '';
border-left: 26px solid transparent;
border-right: 26px solid transparent;
border-top: 26px solid;
border-top-color: #079199;
top: 100%;
left: 50%;
}
<div class="news">
TEST
</div>
【问题讨论】:
-
也许我很困惑,但是哪里有一个三角形?