下滑动滚动条实例

文章目录
步骤 1) 添加 HTML:

创建导航栏:

例子

<div id=”navbar”>
  <a href=”#home”>Home</a>
  <a href=”#news”>News</a>
  <a href=”#contact”>Contact</a>
</div>
步骤 2) 添加 CSS:

设置导航栏样式:

例子

#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地址:3.12.155.235,归属地:俄亥俄州Dublin ,欢迎您的访问!

温馨提示 : 非特殊注明,否则均为李联华的博客原创文章,本站文章未经授权禁止任何形式转载
文章链接:https://www.ooize.com/slide-scroll-bar-instance.html
订阅
提醒
guest
0 评论
内联反馈
查看所有评论
Loading...