如何居中导航栏水平居中和垂直居中?导航栏水平+垂直居中
HTML代码
CSS代码
.nav {
background-color: #CCCCCC;
font-family: 'Source Sans Pro', sans-serif;
height: 45px;
padding-left: 170px;
}
.content {
width: 800px;
height: 500px;
margin:0 auto;
}
.nav ul li {
list-style-type: none;
text-align: center;
width: auto;
float: left;
padding-left: 10px;
padding-right: 10px;
margin:0 auto;
}
.nav a {
display: block;
padding-top: 2px;
padding-bottom: 2px;
color: #000000;
text-decoration: none;
}
我已经把它居中置于水平位置,但我怎样才能将它居中置于垂直位置?
我希望你的答案,
感谢菲利克斯