【发布时间】:2017-04-05 14:56:27
【问题描述】:
【问题讨论】:
标签: css border rounded-corners
【问题讨论】:
标签: css border rounded-corners
尝试像这样使用边框半径
div {
width: 10px;
height:40px;
background-color: black;
border-top-right-radius: 6px;
border-bottom-right-radius:6px;
}
<div></div>
【讨论】:
border-top-right-radius 替换为border-top-left-radius 和border-bottom-right-radius 替换为border-bottom-left-radius
您可以为此使用::after css 伪元素。这是示例fiddle。希望对您有所帮助。
.link {
height: 100px;
width: 100px;
background: red;
position: relative;
overflow: hidden;
}
.link::after{
content: "";
height: 80%;
background: #fff;
width: 20px;
position: absolute;
top: 10%;
left: -10px;
border-radius: 20px;
transition: all .35s;
opacity: 0;
}
.link:hover::after{opacity:1}
<div class="link"></div>
检查此link。您可以从那里了解更多关于 CSS 伪元素的信息。
【讨论】: