我正在创建一个标题,一旦滚动到一定数量的像素后将固定在原位。
我能否仅使用css和html来实现这一点,还是需要jquery?
我已经创建了一个演示,这样你就可以理解了。任何帮助都将非常感谢!
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;
}