我正在尝试垂直对齐相应的文本<li>
。我构建它的方式似乎不太可能,因为盒子本身就是链接。
这是做一个简单导航栏的标准方法,对吧?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<title>
</title>
</head>
<body>
<div id="wrapper">
<div id="navbar">
<ul>
<li><a href="home.php">Home</a></li>
<li><a href="news.php">News</a></li>
<li><a href="roster.php">Roster</a></li>
<li><a href="forums.php">Forums</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
</div>
</div>
</body>
</html>
--
body, div, dl, dt, dd, ul, ol, h1, h2, h3, h4, h5, h6, pre, form, fieldset, input,textarea, p, blockquote, th, td {
margin: 0;
padding: 0;
}
body {
background-image:url("images/gradients/background_gradient.png");
}
#wrapper {
margin: auto;
min-height: 1152px;
width: 1536px;
}
#navbar {
border: 1px solid red;
height: 200px;
width: 100%;
font-size: 2em;
margin: 0;
}
#navbar a {
text-decoration: none;
}
#navbar ul {
display: block;
list-style-type: none;
}
#navbar ul li a {
float: left;
display: block;
height: 200px;
width: 20%;
text-align: center;
letter-spacing: -0.5px;
}
#navbar ul li :hover{
background-color: white;
}