CSS代码:
<style
type="text/CSS">
div#nifty{margin:0background:#9BD1FA}
p
{padding:10px}
div.rtop
{display:blockbackground:#fff}
div.rtop
div
{display:blockheight:1pxoverflow:hiddenbackground:#9BD1FA}
div.r1{margin:0
5px}
div.r2{margin:0
3px}
div.r3{margin:0
2px}
div.rtop
div.r4
{margin:0
1pxheight:2px}
</style>
HTML代码:
<div
id="nifty">
<div
class="rtop">
<div
class="r1"></div>
<div
class="r2"></div>
<div
class="r3"></div>
<div
class="r4"></div>
</div>
<p>div
+
css
圆角矩形
www.865171.cn
</p>
<div
class="rtop">
<div
class="r4"></div>
<div
class="r3"></div>
<div
class="r2"></div>
<div
class="r1"></div>
</div>
</div>
可以利用 :before 伪类放一个蓝色的块上去,(看我头像)然后旋转到合适的角度和大小即可。代码:
<div class="box">
<div class="item">首页</div>
<div class="item corner">查询订单</div>
</div>
<style>
* {
margin:0
padding: 0
}
html {
background: #aab
padding: 10px
}
.box {
height: 60px
line-height: 60px
background: #fff
overflow: hidden
}
.box .item {
float: left
vertical-align: middle
width: 300px
text-align: center
}
.box .item.corner {
background: #698ff4
color: #fff
position: relative
}
.box .item.corner:before {
display: block
content: ' '
width: 120px
height: 120px
position: absolute
left: -36px
top: 0
background: #698ff4
transform: rotate(-45deg)
}
</style>