.parent{
position:relative
height:100%//高度根据需求自行设定
}
.child{
position:absolute
left:0
top:0
right:0
bottom:0 //left,top,right,bottom都为0,充满真个页面
overflow-y:auto
overflow-x:hidden//设置Y轴出现滚动条,X轴隐藏
}
html部分
<div class="parent">
<div class="child"></div>
</div>
---------------------
作者:Franklin_hemm_2012
来源:CSDN
原文:https://blog.csdn.net/franklin_hemm_2012/article/details/78640753
版权声明:本文为博主原创文章,转载请附上博文链接!
css+html实现时间轴1.css
body {
font-size: 12px
}
ul li {
list-style: none
}
.track-rcol {
width: 100%
border: 1px solid #eee
}
.track-list {
margin: 20px
padding-left: 5px
position: relative
}
.track-list li {
position: relative
padding: 9px 0 0 25px
line-height: 18px
border-left: 1px solid #d9d9d9
color: #999
}
.track-list li.first {
color: red
padding-top: 0
border-left-color: #fff
}
.track-list li .node-icon {
position: absolute
left: -6px
top: 50%
width: 11px
height: 11px
background: url(img/trank.png) -21px -72px no-repeat
}
.track-list li.first .node-icon {
background-position: 0 -72px
}
.track-list li .time {
margin-right: 20px
position: relative
top: 4px
display: inline-block
vertical-align: middle
}
.track-list li .txt {
position: relative
top: 4px
display: inline-block
vertical-align: middle
}
.track-list li.first .time {
margin-right: 20px
}
.track-list li.first .txt {
max-width: 600px
}