這裏的HTML代碼本身如何在CSS中居中垂直對齊的菜單?
html {
background: url(wallpaper.jpg) no-repeat center center fixed;
background-size: cover;
}
.header {
text-align: center;
font-family: impact;
font-size: 40px;
margin-left: 500px;
margin-right: 500px;
color: gray;
}
#introduction {
font-family: times;
text-align: center;
text-decoration: underline;
color: #1F1B1B;
}
.paragraph {
text-indent: 20px;
color: gray;
text-align: center;
margin-left: 200px;
margin-right: 200px;
}
.rap {
float: left;
margin-right: 10px;
}
ul li a {
display: block;
text-align: center;
font-family: georgia;
background: rgba(16, 16, 16, 0.4);
width: 130px;
text-decoration: none;
margin: 10px;
padding: 5px;
border: 1px solid black;
border-radius: 5px;
color: white;
font-size: 19px;
vertical-align: middle;
list-style: none;
}
<ul>
<li><a href="#2pac">2pac</a></li>
<li><a href="#Bigge Smalls">Biggie Smalls</a></li>
<li><a href="#Nas">Nas </a></li>
<li><a href="#Jay Z">Jay Z </a></li>
<li><a href="#T.I.">T.I.</a></li>
</ul>
我能做些什麼,以我爲中心菜單本身?它保持向左移動,我希望整個事情死在我的模擬網站。