我做了一个CSS导航栏,但是在每个“navbar-item”之间,都有一点空间。我不希望那里有任何变化!有没有办法做到这一点,而不改变每个navbar-item的余裕?HTML CSS导航栏间距
<!doctype html>
<html>
<head>
<title>Home - UnhandyFir9</title>
<style>
#wrapper {
box-shadow: 0px 0px 20px 10px black;
left: 0px;
top: 0px;
margin: auto;
margin-top: 30px;
width: 800px;
background-color: rgb(200, 200, 200);
font-family: sans-serif;
}
#top-notification {
display: inline-block;
width: 100%;
height: 20px;
background-color: lightblue;
text-align: center;
}
#navbar-core {
width: 100%;
height: 30px;
background-color: lightgreen;
}
#navbar-item {
display: inline-block;
width: 100px;
height: 30px;
text-align: center;
background-color: green;
color: white;
}
</style>
</head>
<body>
<div id="wrapper">
<span id="top-notification">== Hi! Our site was just recently launched, so you may expect alot of bugs! Sorry 'bout that! ==</span>
<div id="navbar-core">
<a href="home.html" id="navbar-item">Home</a>
<a href="lessons.html" id="navbar-item">Lessons</a>
<a href="aboutus.html" id="navbar-item">About Us</a>
<a href="donate.html" id="navbar-item">Donate</a>
</div>
</div>
</body>
</html>
标识** **必须是唯一的。 – j08691
j08691:这不会影响渲染,所有浏览器仍然会正确应用样式。这是一个违反标准的行为,会打破当然的验证,并且令人难以置信地搞砸Javascript。 –
@NielsKeurentjes - 我说它影响渲染还是会解决问题? – j08691