我试图使我的导航栏随页面移动,但如果用户向下滚动则粘在顶部.任何人都可以提供任何示例或如何?非常感激.(我对任何其他语言都没有希望).我尝试使用css粘性但它没有用.
<div class="headercss">
<div class="headerlogo"></div>
<div class="nav">
<ul>
<li><a href="#home"> <br>BLINK</a></li>
<li><a href="#news"><br>ADVERTISING WITH BLINK</a></li>
<li><a href="#contact"><br>EDUCATING WITH BLINK</a></li>
<li><a href="#about"><br>ABOUT US</a></li>
</ul>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
/* www..com
Blinx Service
Created by Pierre Chedraoui
(c) Copyright 2015
*/
/* BODY */
body {
margin: 0px;
background-color: #000000;
height: 2000px;
}
/* 1. HEADER */
.headercss {
width: auto;
height: 320px;
background-color: #000000;
position: relative;
}
.headerlogo {
width: auto;
height: 250px;
background-color: #272727;
position: relative;
}
.nav {
width: auto; …Run Code Online (Sandbox Code Playgroud)