我正在创建一个标题,一旦滚动到一定数量的像素,它就会修复并保持在原位。
我可以只使用 css 和 html 来做到这一点还是我也需要 jquery?
我创建了一个演示,以便您可以理解。任何帮助都会很棒!
http://jsfiddle.net/gxRC9/4/
body{
margin:0px;
padding:0px;
}
.clear{
clear:both;
}
.container{
height:2000px;
}
.cover-photo-container{
width:700px;
height: 348px;
margin-bottom: 20px;
background-color:red;
}
.small-box{
width:163px;
height:100px;
border:1px solid blue;
float:left;
}
.sticky-header{
width:700px;
height:50px;
background:orange;
postion:fixed;
}
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号