我正在尝试创建一个导航栏,在它的中心有一个徽标,然后链接在右边对齐。我还需要能够调整标志的大小。这应该很简单。
有了以下内容,我就可以得到我需要的东西了。我就是不能把徽标放在顶线的中央。
如果我不使用image-size
和figure
,那么徽标是居中的,但我不能调整它的大小。
我在这件事上一直在兜圈子,非常感谢你的帮助
<nav>
<ul class="container">
<li id="lnkHome"> <a href="index.html" >
<img class="image-size" src="https://www.stickpng.com/img/download/5e8ce4a6664eae0004085468/image" />
</a>
</li>
<li class="d">LINK1</li>
<li>LINK2</li>
<li>LINK3</li>
</ul>
</nav>
`
html {
font-size: 100%;
text-align: left;
background-color: rgba(39, 168, 223, 1);
font-family: "Roboto", sans-serif;
color: white;
}
.container {
display: flex;
justify-content: center;
list-style-type: none;
}
#lnkHome {
width: 5;
height: auto;
margin-left: auto;
margin-right: auto;
}
.image-size {
height: auto;
width: 100%;
}
figure {
width: 100px;
}
.d {
margin-left: auto;
}
发布于 2021-03-05 23:58:00
只需从#lnkHome中删除margin-right:auto
https://stackoverflow.com/questions/66495034
复制相似问题