我正在尝试实现如图所示的右上角三角形,但是当我应用边框半径时,为什么它会将边框应用于所有边,因为我只指定了一个边半径。虽然我申请border-top-right-radius: 5px;
而不是border-radius: 0px 5px 0px 0px;
得到相同的结果。有什么帮助吗?
HTML:
<div class="pricing-head">
<h3>Rainmarker</h3>
<span>For up to 10 users</span>
<div class="ribon"></div>
</div>
CSS:
.pricing-head {
background-color: #fff;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
padding: 20px;
}
.pricing-head .ribon {
position: absolute;
top: 0;
right: 0;
width: 75px;
height: 75px;
}
.pricing-head .ribon:before {
content: "";
position: absolute;
right: 0;
top: 0;
border-bottom: 70px solid transparent;
border-left: 70px solid transparent;
border-right: 70px solid #ffad6a;
border-radius: 0 5px 0 0;
}