<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<style>
.top-title {
background:#e74c3c;
color:white;
font-size:24px;
padding:5px;
text-align:center;
position: fixed;
left:0;
top:0;
width:100%;
transition: top .5s;}
.hiddened{top: -90px;}
.showed{top:0;z-index: 9999;}
</style>
</head>
<body>
<div class="top-title">这是顶部导航条</div>
<div class="margint">
HTML5文档的主要内容区域<br />
HTML5文档的主要内容区域<br />
HTML5文档的主要内容区域 HTML5文档的主要内容区域<br />
HTML5文档的主要内容区域 HTML5文档的主要内容区域<br />
HTML5文档的主要内容区域<br />
H
网页下滚的时候,导航栏消失的效果
最新推荐文章于 2023-08-08 17:11:51 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)