【问题标题】:IE8 Not picking up 'Float Left' and 'Fonts'IE8 没有选择“Float Left”和“Fonts”
【发布时间】:2012-05-13 14:12:38
【问题描述】:

嘿,我的网站除了在 IE8 中运行良好。菜单栏显示不正确。我的理论是 Float Left 不起作用,但它可能是别的东西。此外,Calibri 字体也没有正确显示。有什么办法可以解决这两个问题。网址是eagleview.it

这是 index.css 的导航:

nav ul {
width:900px;
list-style: none; 
margin:15px;
position: relative;
}
nav ul li { display::inline;}
nav ul li a {
float:left;
display: block;
padding: 0 15px;
margin: 10px 12px;
color:#fff;
font-weight:600;
font-size:15px;
opacity:1;
}

【问题讨论】:

  • { display::inline;} 应该是 { display:inline;}
  • 另外,我无法右键单击您网站上的检查元素...不知道为什么,但您应该调查一下。我在win7 chrome上

标签: css internet-explorer-8 fonts cross-browser css-float


【解决方案1】:

ie8 无法将“nav”识别为元素。

最简单的选择是更改为 div,或检查modernizr。

<div id="nav">
        <ul class="group">
            <li style="font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif"><a href="about.html" style="text-decoration:none">About</a></li>
            <li style="font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif"><a href="services.html" style="text-decoration:none">Services</a></li>
        <li style="font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif"><a href="testimonials.html" style="text-decoration:none">Testimonials</a></li>
           <li style="font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif"><a href="eagleview.html" style="text-decoration:none">Eagleview</a></li>
            <li style="font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif"><a href="contact.html" style="text-decoration:none">Contact</a></li>
          <li style="font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif"><a href="consulting.html" style="text-decoration:none">Consulting</a></li>
         </ul>
    </div>

用css的

#nal ul li {}
#nav ul li a {}

【讨论】:

  • 更简单的选项是 html5shiv.js
  • @Robbie 好的,我改变了它,现在它在 Firefox 中也搞砸了。检查它和来源
  • @Robbie 我的错误它有效!太感谢了。关于字体跨浏览器的任何想法?
  • 不确定“字体跨浏览器”是什么意思?如果您想知道如何将字体嵌入到不同的浏览器中:fontsquirrel.com/fontface/generator
猜你喜欢
  • 2011-03-17
  • 2017-08-02
  • 1970-01-01
  • 2010-09-17
  • 1970-01-01
  • 2014-06-18
  • 2011-03-24
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多