Html 位置:固定;在我的css菜单中添加了一些时髦的东西

Html 位置:固定;在我的css菜单中添加了一些时髦的东西,html,css,menu,position,fixed,Html,Css,Menu,Position,Fixed,我希望我的.nav被修复,并与您一起向下滚动页面,但我不知道如何阻止它在位置:修复时出错;是放进去的 它适用于位置:固定,但您需要设置右侧,而不是左侧 .nav {position: fixed; top: 0; right: 0;} .nav ul {margin-top: 0;} 您想将顶部导航设置为“粘贴在顶部”还是什么? .top { background-color: #333333; opacity:0.85; padding: 16px; color: white; fo

我希望我的
.nav
被修复,并与您一起向下滚动页面,但我不知道如何阻止它在位置:修复时出错;是放进去的


它适用于
位置:固定
,但您需要设置
右侧
,而不是
左侧

.nav {position: fixed; top: 0; right: 0;}
.nav ul {margin-top: 0;}

您想将顶部导航设置为“粘贴在顶部”还是什么?
.top    {
background-color: #333333;
opacity:0.85;
padding: 16px;
color: white;
font-family: Lato;
font-size: 16px;
vertical-align: middle;
margin: 0;
position: fixed;
width: 100%;   }


.top p  {
display: inline;   }

.nav    {
top: 0;
left: 0;
position: fixed;   }


.nav li     {
list-style-type: none;
z-index: 1;
position: relative;
width: 115px;
margin-right: 40px;
text-align: center;
float: right;
right: 20px;   }


.nav a      {
    display: inline-block;
    padding: 15.5px;
    text-decoration: none;
    color: white;
    font-family: Lato;
    opacity: 0.6;   }
.nav {position: fixed; top: 0; right: 0;}
.nav ul {margin-top: 0;}