所以我在这里有一些代码,我想让我的主导航在中间,然后是右上角的帐户和购物车选项卡。我希望它以一种方式显示“买入、卖出、交易……等”的标签直接位于中间,而不是位于页面左侧以及帐户和购物车容器的中间。
CSS
header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30p 10%;
text-align: center;
transition: all 0.4s ease 0s;}
.navigation {
list-style: none;
width: 10000px;
margin: 1%;}
.navigation li {
display: inline-block;
padding: 10px 20px;
float: center;}
.navigation li a {
transition: all 0.4s ease 0s}
.navigation li a:hover{
color:#75593e }
.home {
width: 65px;
height: 55px;
background: url("/images/ClosedBoxLogo.png");}
.home:hover {
background: url("/images/OpenBox.png") no-repeat;}
/* Cart and Account */
.rightside {
display: flex;
list-style: none;
align-items: center;
justify-content: space-between;}
.rightside li {
padding: 10px 20px;}
这是我的 HTML
<body>
<header>
<ul class="navigation">
<li><a href="#">Buy</a></li>
<li><a href="#">Sell</a></li>
<li><a href="index.html"><img class="home" src="images/CloseBox.png" alt="Close Box" onmouseover="this.src='images/OpenBox.png';" onmouseout="this.src='images/CloseBox.png';"/></a></li>
<li><a href="#">Sell</a></li>
<li><a href="#">Buy</a></li>
</ul>
<ul>
<div class="rightside">
<li><a href="#"> Account </a></li>
<li><a href="#"> Cart </a></li>
</div>
</ul>
</header>
</body>