ここにあなたが欲しいものがありますか?詳細はリンクを参照してください
以下の例のロゴはulクラスの外にありますが、liクラスの間にロゴを設定することもできます。メニューの中にロゴがあります。 JSのために
HTML
<div id="header">
<a class="logo" href="index.html"><img src="http://i48.tinypic.com/2mob6nb.png" alt="Michigan State" /></a>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="index.html">Stats</a></li>
<li><a href="index.html">Schedule</a></li>
<li><a href="index.html">Store</a></li>
<li><a href="index.html">Gallery</a></li>
<li><a href="index.html">Roster</a></li>
</ul>
</div><!--end header-->
CSS
body {
font-family: Helvetica, Arial, Century;
font-size: 12px;
margin: 0;
background: url('images/bluebg.jpg') repeat-x top center;
}
#header {
background-color: #ffd727;
height: 40px;
position: relative;
margin: 150px auto 0;
}
#header ul {
margin: 0 auto;
width: 800px;
padding: 0;
list-style: none;
}
#header ul li {
float: left;
width: 97px;
}
#header ul li:nth-of-type(4) {
margin-left: 217px;
}
#header ul li a {
text-transform: uppercase;
text-decoration: none;
display: block;
text-align: center;
padding: 12px 0 0 0;
height: 28px;
}
#header ul li a:hover {
background: rgb(235,200,35);
}
.logo {
position: absolute;
left: 50%;
margin: -48px 0 0 -108px;
}
@media screen and (max-width: 800px) {
.logo {
bottom: 100%;
}
#header ul li:nth-of-type(4) {
margin-left: 0;
}
#header ul {
width: 600px;
position: relative;
}
}
- このリンクを下回る
http://codepen.io/wolfcry911/pen/HyLdg
を参照してください。
方法2あなたはまた、左右異なるmenu..but方法1でそれを行うことができます
はWP
http://foundation.zurb.com/forum/posts/1832-logo-centered-in-top-bar
に最適です