【发布时间】:2018-11-09 14:25:18
【问题描述】:
如何在使用边框宽度时添加边框半径?我想添加 15px 的 border-top-left-radius。
我有这段代码来创建一个三角形对象,它看起来不错,但我希望该对象在左上角有边框半径。但是,如果我使用border-top-left-radius: 15px;,则对象不是三角形而是正方形。
目前我使用的是 Bootstrap 3.3.7。
.exclusive-price{
position: absolute;
width: 0;
height: 0;
border-style: solid;
border-width: 160px 160px 0 0;
border-color: #C00000 transparent transparent transparent;
/* if use this the object will be a square */
/*
border-top-left-radius: 15px;
*/
}
.exclusive-price>label{
position: relative;
top: -110px;
left: -5px;
text-decoration: none;
word-wrap: normal;
min-width: 140px;
font-size: 20px;
color: #fff;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="exclusive-price"><label>Most Effective</label></div>
【问题讨论】:
标签: html css twitter-bootstrap-3