请用IE7布局漂浮故障帮助新手

时间:2012-04-24 23:01:31

标签: html css layout internet-explorer-7 css-float

我对网页设计很陌生,需要一些帮助。我设计的网站主要是使用960.gs CSS框架,除了我在标题中使用了一些浮点数,标题现在在IE7中给我一些问题(和IE6但我不打算用IE6打扰)。

问题在于H1是我的徽标(使用了图像替换),它已经向上移动,导航ul从它应该从左边移动到左边。

任何人都可以告诉我如何修复标题的以下代码,以便在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:someone@example.com?Subject=Information%20Request">info@example.com</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;
}

谢谢!

1 个答案:

答案 0 :(得分:0)

将h1标签包裹在<div>标签内,并为您的div标签添加所有样式。这应该可以解决问题。