NGL*_*GLN 15
你是说像这个演示小提琴吗?

HTML:
<div class="box">
<div class="head">
<div class="like"></div>
<h3>User927</h3>
</div>
<div class="cont">
<p>Lorem ipsum...</p>
</div>
<div class="foot">
<a href="">More</a>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
.box {
width: 310px;
position: relative;
}
.head {
background: black;
color: white;
}
.cont {
border-left: 1px solid silver;
border-right: 1px solid silver;
}
.foot {
background: lightgray;
border: 1px solid silver;
border-bottom-width: 3px;
}
.head:before,
.head:after,
.foot:before,
.foot:after {
font-size: 0px;
content: ".";
position: absolute;
}
.head:before {
border-top: 5px solid white;
border-right: 5px solid black;
left: 0;
top: 0;
}
.head:after {
border-top: 5px solid white;
border-left: 5px solid black;
right: 0;
top: 0;
}
.foot:before {
border-bottom: 7px solid white;
border-right: 7px solid transparent;
left: 0;
bottom: 0;
}
.foot:after {
border-bottom: 7px solid white;
border-left: 7px solid transparent;
right: 0;
bottom: 0;
}
Run Code Online (Sandbox Code Playgroud)
缺点:对于IE7,您需要在标记中添加额外的跨度,因为不支持:after和:before说明符,请参阅此修订后的小提琴.
您可以使用 CSS 制作圆角(例如图像中的 28/like),但是像容器顶部那样的切角需要图像。
| 归档时间: |
|
| 查看次数: |
20024 次 |
| 最近记录: |