[英]How to make a sticky navigation bar on the right side of the page?
Generally to speak this is kind of a wierd idea to put a navbar to the right side.一般来说,将导航栏放在右侧是一种奇怪的想法。 All the browsers put the scrolbar to te right side.
所有浏览器都将滚动条放在右侧。
Anyways无论如何
you should apply css to the site.您应该将 css 应用于该站点。
.navbar{
background-color:red;
position:sticky;
height:100vh;
top:0;
float:right;
}
.content{
height:2000px;
margin-top:10px;
margin-right:120px;
border: 1px solid red;
}
And in the html并在 html
<div class="navbar">
This is the navbar
</div>
<div class="content">
Content
</div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.