图片有点长,请向下滚动查看代码 .
我试图使这个导航栏垂直对齐,而它看起来太难看了 . 如何将Logo移动到导航链接的顶部,导航链接可以垂直和水平移动到导航的中心 . 导航栏必须是全高并固定 . 这是代码:
.site-header {
text-align: center;
position: fixed;
top: 0;
left: 0;
display: flex;
flex-direction: column;
width: 18rem;
height: 100vh;
margin:auto !important
}
.logo {
display: flex;
margin: auto auto 0;
padding: 0.5rem;
}
.primary-menu {
flex-direction: column;
width: 100%;
}
.primary-menu > li {
display: block;
}
2 回答
看看这段代码 . 我看不到你的标志,这就是我没有包含它的原因 . 但你可以使用那里的格式来做到这一点
请使用以下css: