0
是否可以在其绘制的位置制作div fixed
(标准“static
/relative
”位置)?将div设置为固定在相对位置
所以我想div .one
,.three
和.four
被固定在它最初绘制的位置。这样它就不会滚动。 https://jsfiddle.net/sor8hntk/2/
是否可以在其绘制的位置制作div fixed
(标准“static
/relative
”位置)?将div设置为固定在相对位置
所以我想div .one
,.three
和.four
被固定在它最初绘制的位置。这样它就不会滚动。 https://jsfiddle.net/sor8hntk/2/
是的! https://jsfiddle.net/sor8hntk/7/
body {
margin-top:40px;
}
.one {
float:left;
background-color:green;
width:33%;
height:50px;
position: fixed;
}
.two {
float:left;
background-color:red;
width:33%;
height:500px;
left: 33%;
position: absolute;
}
.three {
float:left;
background-color:blue;
width:33%;
height:50px;
position: fixed;
left: 66%;
}
.four {
width:33%;
background-color:purple;
height:10px;
position: fixed;
}
.five {
width:100%;
background-color:pink;
margin-top: 10px;
}
.six {
width:100%;
height:10px;
background-color:yellow;
}
是这样的? https://jsfiddle.net/repzeroworld/96g3pLmc/ – repzero
收回我的答案,直到你澄清你的预期结果。 – repzero