当我在手机尺寸中查看时,我有一个徽标,我正试图在我的侧边栏中居中。现在它保持与侧边栏左侧齐平。你可以看到它live here。
这是我的HTML代码:
<aside class="navbar navbar-inverse">
<div class="navbar-inner"><a href="#"><img src="img/kobe_logo.png" class="phone-logo visible-phone"></a>
<ul class="nav pull-right">
<li><a href="#" style="color: #999;"><i class="icon-time icon-2x icon-white"></i> <span class="misc"><strong>Open Everyday! 11am - 10pm</strong></span></a></li>
<li><a href="#" style="color: #999;" class="visible-desktop visible-tablet"><i class="icon-phone-sign icon-2x"></i> <span class="misc"><strong>(512) 288-7333</strong></span></a></li>
<li><a href="tel:+15122887333" class="visible-phone"><i class="icon-phone-sign icon-2x"></i> <span class="misc"><strong>(512) 288-7333</strong></span></a></li>
<li><a href="https://maps.google.com/maps?q=Kobe+Japanese+Steakhouse&hl=en&cid=14743286964168532232&gl=US&t=m&z=16&iwloc=A"><i class="icon-flag icon-2x icon-white"></i> <span class="misc"><strong>Locate KOBE</strong></span></a></li>
<li><a href="https://www.facebook.com/pages/Kobe-Japanese-Steakhouse-Austin-Texas/308215040224"><i class="icon-facebook-sign icon-2x icon-white"></i> <span class="misc"><strong>See KOBE on Facebook!</strong></span></a></li>
</ul>
</div>
注意:只有在手机布局中查看时才会出现此问题。当以较大尺寸查看时,我将隐藏此特定徽标位置。
答案 0 :(得分:0)
尝试将class =“logo_sidebar”移至包含链接标记
<a href="#/" class="logo_sidebar"><img src="img/kobe_logo.png"></a>
并用以下内容替换css文件中的.logo_sidebar:
.logo_sidebar {text-align:center; display:block;}
.logo_sidebar img {margin:2.3em 0 2em; }