我想要垂直居中一个div为我的标志我的导航水箱内垂直股利。我已经研究过其他话题,但没有一个给我提供了一个很好的解决方案。你们任何人都可以给我一个很好的解决方案响应中心内,容器
看着:How to vertically center a div for all browsers?,但这并没有解决我的问题。
的目标是让DIV类左侧垂直居中标志与导航右侧的股利类垂直居中。
段:
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
font-size: 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, Sans-Serif;
vertical-align: baseline;
outline: none;
}
#header {
background: #00968B;
height: 58px;
}
.logo {
height: 58px;
}
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/main.css">
</head>
<body>
<div id="header">
<div class="container">
<div class="logo">
logo
</div>
<div class="nav">
</div>
</div>
</div>
</body>
</html>
可能重复[如何垂直居中所有浏览器的div?](http://stackoverflow.com/questions/396145/how-to-vertically-center-a-div-for-all-browsers) – Aaron
看着那些人没有解决我的问题。没有垂直居中并且没有工作。 @Aaron +也没有反应。 – BPrepper