如何制作一个导航栏,它将像本网站 https://preview.colorlib.com/theme/engineers/ 中的那样隐藏滚动上的第一个会话?
How to make a Navbar that will hide the first session on scroll like this one like one in this site https://preview.colorlib.com/theme/engineers/?
我不知道我会使用什么是正确的英语 google 当然有 jsfiddle 或其他我需要的资源,我正在寻找创建这样的导航栏:https://preview.colorlib.com/theme/engineers/
试试这个!
HTML
<div class="navbar">
<a href="#home">Home</a>
<a href="#news">News</a>
<a href="#contact">Contact</a>
</div>
<div class="main">
<p>Some text some text some text some text..</p>
</div>
css
/* The navigation bar */
.navbar {
overflow: hidden;
background-color: #333;
position: fixed; /* Set the navbar to fixed position */
top: 0; /* Position the navbar at the top of the page */
width: 100%; /* Full width */
}
/* Links inside the navbar */
.navbar a {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
/* Change background on mouse-over */
.navbar a:hover {
background: #ddd;
color: black;
}
/* Main content */
.main {
margin-top: 30px; /* Add a top margin to avoid content overlay */
}
我不知道我会使用什么是正确的英语 google 当然有 jsfiddle 或其他我需要的资源,我正在寻找创建这样的导航栏:https://preview.colorlib.com/theme/engineers/
试试这个!
HTML
<div class="navbar">
<a href="#home">Home</a>
<a href="#news">News</a>
<a href="#contact">Contact</a>
</div>
<div class="main">
<p>Some text some text some text some text..</p>
</div>
css
/* The navigation bar */
.navbar {
overflow: hidden;
background-color: #333;
position: fixed; /* Set the navbar to fixed position */
top: 0; /* Position the navbar at the top of the page */
width: 100%; /* Full width */
}
/* Links inside the navbar */
.navbar a {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
/* Change background on mouse-over */
.navbar a:hover {
background: #ddd;
color: black;
}
/* Main content */
.main {
margin-top: 30px; /* Add a top margin to avoid content overlay */
}