代码:
<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>
#welcome ul li em { display:blockfloat:leftheight:7pxmargin:6px 0border-right:1px solid #bcbcbcoverflow:hidden}#welcome ul li em [选择ID为welcom的容器下ul li 里的em元素为样式试用对象]
display:block[做为块元素显示]
float:left[靠左浮动,默认li元素是列显示,用了float可以让容器在一行内显示]
height:7px[高7像素]
margin:6px 0[子容器距父容器上下边框的距离分别为6像素,等同于margin:6px 0 6px 0]
border-right:1px solid #bcbcbc[容器右边框显示为1像素,实线,颜色为#bcbcbc]
overflow:hidden[超出容易可见面积部分内容不显示]