gpt4 book ai didi

html - 为什么我的列表左侧比右侧大?

转载 作者:太空宇宙 更新时间:2023-11-04 04:09:58 26 4
gpt4 key购买 nike

我不知道为什么,但是如果你运行这段代码,导航栏的左侧比右侧大一点,有人能告诉我为什么吗?看起来我没有在左侧放置任何额外的列表项。提前致谢。

<!DOCTPYE html>
<html>
<head>
<style>
html {
height: 100%;
width: 100%;
font: 25 calibri;
text-align: center;
background: linear-gradient(black,white);
}
#mainContent {
margin: 0 auto;
margin-top: -25px;
width: 800px;
background-color: white;
height: 1000px;
}
a:link, a:visited {
text-decoration: none;
color: grey;
}
a:hover {
color: #ccc;
}
li {
display: inline-block;
}
nav {
margin: 0 auto;
margin-top: 60px;
width: 720px;
background-color: brown;
text-align: center;
}
</style>
</head>
<body>
<nav>
<ul>
<li id="currentPage"><a href="index.html"><b>HOME</b></a></li>
<li>|</li>
<li><a href="updates.html">UPDATES</a></li>
<li>|</li>
<li><a href="tournaments.html">TOURNAMENTS</a></li>
<li>|</li>
<li><a href="recruitments.html">RECRUITMENTS</a></li>
<li>|</li>
<li><a href="contact.html">CONTACT</a></li>
</ul>
</nav>
<div id="mainContent">
</div>
</body>
</html>

最佳答案

将此样式用于您的列表

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

然后检查并告诉我。

关于html - 为什么我的列表左侧比右侧大?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20828301/

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