我做了一個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