0
我嘗試使導航欄的圖像居中,圖像中間的文字位於中間,但問題是我無法在至少有一點工作的事情。我現在的代碼示例如下。任何建議如何解決?導航欄圖像中間居中,文字兩側圖像
<meta name="viewport" content="width=device-width, initial-scale=1">
* {box-sizing:border-box}
body {font-family: Verdana,sans-serif; margin:0; padding: 0;}
.topBar {
\t overflow: hidden;
\t background-color: #333;
\t height: 45px;
\t position: relative;
\t width: 100%;
}
.topBar a {
vertical-align: middle;
\t float: left;
\t overflow: auto;
\t display: inline-block;
\t padding: 2px 16px;
\t font-family: courier;
\t font-size: 20px;
\t color: #f2f2f2;
\t transition: 0.6s ease;
}
.topBar a:hover {
\t background-color: rgba(0,0,0,0.5);
}
.topBar-logo {
\t position: absolute;
\t left: 50%;
}
.topBar-textLeft {
\t float: right;
}
.topBar-textRight {
\t float: left;
}
<div class="topBar">
<div class="topBar-textLeft">
<a>Informacie</a>
<a>Domov</a>
</div>
<img src="http://i.imgur.com/ZbKfy4E.png" class="topBar-logo">
<div class="topBar-textRight">
<a>Album</a>
<a>Kontakt</a>
</div>
</div>