下滑动滚动条实例
文章目录
步骤 1) 添加 HTML:
创建导航栏:
例子
<div id=”navbar”>
<a href=”#home”>Home</a>
<a href=”#news”>News</a>
<a href=”#contact”>Contact</a>
</div>
步骤 2) 添加 CSS:
<div id=”navbar”>
<a href=”#home”>Home</a>
<a href=”#news”>News</a>
<a href=”#contact”>Contact</a>
</div>
设置导航栏样式:
例子
#navbar {
background-color: #333; /* Black background color */
position: fixed; /* Make it stick/fixed */
top: -50px; /* Hide the navbar 50 px outside of the top view */
width: 100%; /* Full width */
transition: top 0.3s; /* Transition effect when sliding down (and up) */
}
/* Style the navbar links */
#navbar a {
float: left;
display: block;
color: white;
text-align: center;
padding: 15px;
text-decoration: none;
}
#navbar a:hover {
background-color: #ddd;
color: black;
}
#navbar {
background-color: #333; /* Black background color */
position: fixed; /* Make it stick/fixed */
top: -50px; /* Hide the navbar 50 px outside of the top view */
width: 100%; /* Full width */
transition: top 0.3s; /* Transition effect when sliding down (and up) */
}
/* Style the navbar links */
#navbar a {
float: left;
display: block;
color: white;
text-align: center;
padding: 15px;
text-decoration: none;
}
#navbar a:hover {
background-color: #ddd;
color: black;
}
温馨提示 : 非特殊注明,否则均为©李联华的博客网原创文章,本站文章未经授权禁止任何形式转载;IP地址:18.220.164.195,归属地:俄亥俄州Dublin ,欢迎您的访问!
文章链接:https://www.ooize.com/slide-scroll-bar-instance.html
文章链接:https://www.ooize.com/slide-scroll-bar-instance.html
订阅
登录
0 评论