请帮助新手与IE7布局浮动小故障

问题描述:

我很新的网页设计,需要一点帮助。我设计的网站大多使用960.gs CSS框架,除了我在标题中使用了一些浮动功能,并且标题现在在IE7(和IE6中给了我一些问题,但我不打算与IE6打扰)。请帮助新手与IE7布局浮动小故障

问题在于H1是我的标志(已使用图像替换),它已向上移动,而导航标志从其应该从其右侧向左侧漂移的位置移动。

任何人都可以请告诉我如何修复以下代码的标题,以便它在IE7中工作?

HTML

<div class="intro"> 

    <div class="container_12"> 


      <header> 

      <div class="meta_bar"> 
       <ul> 
        <li><span>Free Quote:</span></li> 
        <li id="phone">444-444-4444</li> 
        <li id="email"><a href="mailto:[email protected]?Subject=Information%20Request">[email protected]</a></li> 
       </ul> 
      </div> 

      <h1><a href="index.html">ExampleCompany</a></h1> 

      <nav> 

       <ul> 
        <li class="selected"><a href="index.html">Home</a></li> 
        <li class=""><a href="services.html">Services</a></li> 
        <li class=""><a href="about.html">About</a></li> 
        <li class=""><a href="contact.php">Contact</a></li> 
       </ul> 

      </nav> 

      <p> 
       Lorem ipsum dolor sit amet, consectetur adipiscing elit integer in elit orci, a eleifend velit. 
      </p> 

     </header> 

     </div><!--end header container--> 

</div><!--end intro--> 

CSS

.intro { 
    border-top: 10px solid black; 
} 

.meta_bar { 
    font-size: 12px; 
    color: #8e8e8e; 
    padding-top: 24px; 
    float: right; 
} 

.meta_bar span { 
    font-size: 11px; 
    text-transform: uppercase; 
} 

.meta_bar li { 
    display: inline; 
    margin-left: 0.5em; 
    padding-left: 1.5em; 
} 

.meta_bar a { 
    color: #8e8e8e; 
} 

#phone { 
    background: url(../img/phone.png) no-repeat left center; 
} 

#email { 
    background: url(../img/email.png) no-repeat left center; 
} 

header { 
    padding: 0 10px; 
} 

header h1 { 
    float: left; 
    clear: both; 
    padding: 12px 0 20px 0; 
    } 

header h1 a { 
    width: 228px; 
    height: 65px; 
    display: block; 
    background: url(../img/sprite.png) 0 0 no-repeat; 
    text-indent: -9999%; 
    } 

nav { 
    float: right; 
    margin-top: 36px; 
} 

nav li { 
    display: inline; 
    margin: 0 0 0 20px; 
} 

nav a { 
    font-size: 14px; 
    text-transform: uppercase; 
    font-weight: bold; 
    color: black; 
    text-decoration: none; 
} 

nav a:hover { 
    color: #e8960b; 
    text-decoration: none; 
} 

.selected a { 
    color: #e8960b; 
} 

header p { 
    clear: both; 
    border-top: 2px dashed #8e8e8e; 
    text-align: center; 
    font-family: Garamond, “Hoefler Text”, Times New Roman, Times, serif; 
    font-size: 18px; 
    padding: 22px 0 22px 0; 
} 

谢谢!

将您的h1标签包裹在<div>标签中,并为您的div标签提供所有的样式。这应该解决这个问题。

+0

嗯......我把h1放在一个带“logo”类的div里,然后用下面的CSS: – 2012-04-24 23:38:03

+0

.logo { \t float:left; \t明确:均; \t padding:12px 0 20px 0; \t} – 2012-04-24 23:39:34

+0

仍然没有工作:/ – 2012-04-24 23:40:14