我有一个 spring boot 项目,那是我的导航栏的照片。当用户向下滚动时,我希望导航栏粘在页面顶部,但我不知道该怎么做。我是前端新手,我正在努力了解引导程序、html 和 css 等。
<nav class="navbar navbar-inverse">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-3">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="userProfile1">Home</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="navbar-collapse-3">
<ul class="nav navbar-nav navbar-right">
<li><a href="/calendar">Calendar</a></li>
<li><a href="/subjectSearch">Search</a></li>
<li><a href="/logout">Logout</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container -->
</nav><!-- /.navbar -->
这是我的 css 文件的样子:
h1 {
color: #78ab46;
}
.error-message {
color: #a94442;
}
.error-message:first-letter {
text-transform: capitalize;
}
蛊毒传说
12345678_0001
相关分类