我想要垂直居中一個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