gpt4 book ai didi

html - 如何制作带有居中 Logo 的导航栏

转载 作者:太空宇宙 更新时间:2023-11-03 19:25:13 24 4
gpt4 key购买 nike

我正在尝试做一个带有居中标志的导航栏,但我做不到正确的方法。

html,
body {
height: 100%;
}

body {
margin: 0;
}

nav {
display: flex;
width: 100%;
height: 5%;
background: #eee;
align-items: center;
justify-content: center;
}

a {
text-decoration: none;
color: rgba(0, 0, 0, 0.8);
margin: 0 40px;
}

.circle {
height: 150px;
width: 150px;
background-color: #eee;
border-radius: 550%;
display: inline;
}
<nav>
<a href="">Menu</a>
<a href="">Menu</a>
<span class="circle"></span>
<a href="">Menu</a>
<a href="">Menu</a>

我期待这样的结果,这是我在 Photoshop 中完成的: Logo

最佳答案

演示:https://codepen.io/phong18/pen/KKPyzro

html:

<nav>
<div class="left-box">
<a href="">Menu</a>
<a href="">Menu</a>
</div>
<span class="circle"></span>
<div class="right-box">
<a href="">Menu</a>
<a href="">Menu</a>
</div>
</nav>

添加更多的CSS:

.left-box,.right-box{
width: 50%;
display: inline-block;
}
.left-box{
text-align: left;
}
.right-box{
text-align: right;
}

关于html - 如何制作带有居中 Logo 的导航栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57781497/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com