我想修复第一个和最后的div当我在这个例子中搭售双击自动滚屏的jsfiddle例如这里像这一形象。
我在平板电脑上尝试过,但无法正常工作
这是CSS
.mother_div {
display:block;
height:auto;
width:500px;
border:1px solid #000;
overflow-x:scroll;
}
.child_divs {
height:40px;
margin-bottom:1px;
background:green;
display:block;
width:1000px;
}
.child_divs div {
float:left;
line-height:40px;
color:#fff;
font-size:15px;
width:100px;
text-align:center;
}
.child_divs div:first-child {
background:#ccc;
color:#000;
}
.child_divs div:last-child {
background:#ccc;
color:#000;
}
那这个呢?
.child_divs div:first-child {
background:#ccc;
color:#000;
position: fixed;
left: 0;
}
.child_divs div:first-child + div {margin-left: 100px;}
.child_divs div:last-child {
background:#ccc;
color:#000;
position: fixed;
right: 0;
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句