gpt4 book ai didi

html - nav li 标签的自动宽度

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

我正在尝试制作我的导航我正在尝试制作我的导航我正在尝试制作我的导航我正在尝试制作我的导航我正在尝试制作我的导航我正在尝试制作我的导航我正在尝试制作我的导航我正在尝试制作我的导航我正在尝试制作我的导航

<div class="headercss">class="header">

<div class="headerlogo">class="header">

</div>


</div>

/* BODY */

body {
margin: 0px;
background-color: #000000;
}


/* 1. HEADER */

.headercssheader {
width: auto;
height: 500px;
position: relative;
}

.headerlogoheader {
width: 980px;
height: 250px;
position: relative;
left: 50%;
margin-left: -490px;
}

.nav {
width: 980px;
height: 70px;
position: relative;
left: 50%;
margin-left: -490px;
}

ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
}

li {
float: left;
}

a:link, a:visited {
display: block;
}

a:hover, a:active {
}

最佳答案

将此 CSS 添加到您的 ul 标记中:

display:table;
table-layout: fixed;

这是你的 li CSS:

display: table-cell;

应该工作 :)

关于html - nav li 标签的自动宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28450357/

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