这是我的CSS代码:
.sidenav {
height: 100%;
width: 160px;
position: fixed;
z-index: 1;
top: 0;
left: 0;
background-color: #111;
overflow-x: hidden;
padding-top: 20px;
}
.sidenav a {
padding: 6px 8px 6px 16px;
text-decoration: none;
font-size: 25px;
color: #818181;
display: block;
}
@media screen and (max-height: 450px) {
.sidenav {padding-top: 15px;}
.sidenav a {font-size: 18px;}
}
我已经尝试过弄乱右侧和抬高以及左侧和右侧的填充,但是我尝试过的所有操作都将侧边栏固定在左侧。如何使其移至右侧?提前致谢!
Change your
.sidenav
class propertyleft
toright
:What
left: 0
means is anchor the div to the relative container 0 pixels from the left side, changing it toright: 0
tells the css it to anchor it 0 pixels from the right side.