css - Logo img 使 IE 8 中的 Bootstrap 导航栏崩溃

标签 css internet-explorer twitter-bootstrap

我正在使用 Twitter Bootstrap。我不会写很长,只是给你看。(没有 img 一切都很好)

IE截图: https://www.dropbox.com/s/k1dn6ss1ue5y2c9/ie_screen.png

普通浏览器: https://www.dropbox.com/s/bp0spch1yvowglp/chrome_screen.png

HTML代码:

   <div class="topbar"> 
<div class="navbar ">
     <div class="container">                 
    <ul class="nav nav-pills pull-left">       
      <li><%= link_to "Overview",    root_path %></li>
      <li class="divider-vertical"></li>
      <li><%= link_to "About",    about_path %></li>
      <li class="divider-vertical"></li>
      <li><%= link_to "What we do", what_we_do_path %></li>
      <li class="divider-vertical"></li>
      <li><%= link_to "Partners", partners_path %></li>
      <li class="divider-vertical"></li>
      <li><%= link_to "Contact", contact_path %></li>
      <li class="divider-vertical"></li>        
    </ul>
</div>
 </div>
   </div>

我的 CSS:

.container{
background-color: white;
width: 960px;
}

.navbar .nav {
background-color: white;
position: relative;
display: block;
float: left;
margin: 0 0px 0 0;
 }

.navbar .nav .active > a, .navbar .nav .active > a:hover {
padding-top:0px;
padding-bottom:0px;
color: black;
text-decoration: none;
background-color: white;
}

 .navbar .nav img{
float:left;
}

最佳答案

在 View 中:

    <%= link_to(image_tag("/images/logo.png"), root_path, id: "logo") %>

CSS:

#logo{
float:left;
}

关于css - Logo img 使 IE 8 中的 Bootstrap 导航栏崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11153763/

相关文章:

css - 使用条件注释删除内容?

internet-explorer - Internet Explorer toDataURL()的替代品?

html - 流体布局面板未扩展到底部

javascript - 在我开始输入之前,contentEditable div 中的光标太大

jquery 应用 css 标签

javascript - IE 没有在 onblur 事件中调用函数

html - Bootstrap 导航项未在移动设备上显示

javascript - Bootstrap Pill 不是 "tabbing"内容

javascript - 我怎样才能让箭头图像放在 "answer1"的左边

css - 纯 CSS 折叠/展开 div