给我你的怀抱2017-05-19 10:42:27
利用border
以及:after
實現, 為了觀看效果方便,以下demo線條寬度設定為2px.
線上預覽
html >>>>>>
<p class='treeline'></p>
css >>>>>>
.treeline {
display: inline-block;
width: 100px;
height: 26px;
padding: 12px 0;
box-sizing: border-box;
border-left: 2px solid #888;
}
.treeline:after {
content: '';
display: block;
width: 100%;
height: 100%;
background: #888;
}
某草草2017-05-19 10:42:27
豎線用border,橫線用before
.list-ui{
position: relative;
margin-left: 5px;
padding-left: 45px;
border-left: 1px solid #ccc;
}
.list-ui:before{
position: absolute;
top: 50%;
left: 0;
margin-top: -0.5px;
content: '';
display: block;
width: 40px;
height: 1px;
background: #ccc;
}