跨浏览器显示问题

发布于 2024-11-19 18:30:59 字数 19216 浏览 2 评论 0原文

经过进一步调查,我发现我的 CSS 中有一些东西使我的导航显示很有趣 ->我的innerPage和下面的HTML(主页)上的所有内容都加载得很好,但我仍然被导航逼疯了,所以我上传了完整的html和css来解决这个问题,

HTML:

<div id="container"> 

<header> 
                <h1>company</h1> 
                <div id="logo"><a href="http://company.co.nz/">Home</a></div> 

<section id="sales"> 
        <p></p> 

</section> 

<section id="searchBox"> 

    <form id="searchBoxForm"> 
        <fieldset> 
                <input type="text" name="search" id="search" placeholder="Search Here" /> 
                <input class="submit" type="submit" name="submit" id="submit" value="Search" /> 
        </fieldset> 

    </form> 

</section> 

</header><!-- Header End --> 

<nav id="mainMenu"> 
        <ul> 
        <li><a href="#">Nav 1</a> 
        <ul><!--Sub Menu Hosting --> 
                <li><a href="#">Drop Down 1</a></li> 
        </ul><!-- Sub Menu Hosting Ends --> 
        </li> 
        <li><a href="#">Nav 2</a> 
        <ul><!-- Sub Menu Email --> 
                <li><a href="#">I want my own email</a></li> 
        </ul><!-- Sub Menu Email Ends --> 
        </li> 
        <li><a href="#">Nav 3</a> 
        <ul><!-- Sub Menu Support --> 
                <li><a href="#">Need Support?</a></li> 
                </ul><!-- Sub Menu Support Ends --> 
        </li> 
        <li><a href="#">Nav 3</a> 
        <ul><!-- Sub Menu About --> 
                <li><a href="#">About</a></li> 
        </ul><!-- Sub Menu About Ends --> 
        </li> 
        <li><a class="signup" href="#">SIGN UP</a></li> 
        </ul> 
</nav><!-- Main Menu End --> 

<div id="billboard"> 

    <h1 contenteditable="true">Cloud Hosting </h1> 

    <p>Hosting to take you way above the clouds</p> 

</div> 

<article id="services"> 

<section class="service1"> 
        <h2><a href="#">Plan 1</a></h2> 
        <p>Cloud hosting isn't difficult or expensive. OnApp lets hosts deploy clouds in a day, at very low cost.</p> 
        <p><a href="#" class="bullet">More</a></p> 
</section> 

<section class="service2"> 
        <h2><a href="#">Plan 2</a></h2> 
        <p>OnApp maximizes margins with high density, self-organizing clouds and an intuitive control panel.</p> 
        <p><a href="#" class="bullet">More</a></p> 

</section> 

<section class="service3"> 
        <h2><a href="#">Plan 3</a></h2> 
        <p>No more late-night fixes in the data center. OnApp has automatic failover and multi-layered security. </p> 
        <p><a href="#" class="bullet">More</a></p> 
</section> 

<section class="service4"> 
        <h2><a href="#">MS Exchange</a></h2> 
        <p>OnApp's fine control of permissions, limits and pricing lets you tailor the customer experience.</p> 
        <p><a href="#" class="bullet">More</a></p> 

</section> 

<section class="service5"> 
        <h2><a href="#">Domains</a></h2> 
        <p>OnApp's fine control of permissions, limits and pricing lets you tailor the customer experience.</p> 
        <p><a href="#" class="bullet">More</a></p> 
</section> 

</article><!-- Services End --> 

<div id="servicesBanner"> 
    <p>Services: </p> 
</div> 
<ul id="nav-footer"> 
<div id="col">           
</div>
<p>&copy</p> 
</div> <!-- container --> 

        </body> 
</html>

CSS:

body {
    line-height:1;
    font:12px normal helvetica,arial,sans-serif;
    color:gray;
    background:url(includes/images/body-bg.png) 0 0 repeat-x #efefef;
}

ol,ul {
    list-style:none;
}

blockquote,q {
    quotes:none;
}

blockquote:before,blockquote:after,q:before,q:after {
    content:none;
}

h1 {
    margin-bottom:20px;
    font-size:36px;
    line-height:40px;
    color:#58585a;
    font-weight:700;
}

h2 {
    padding-bottom:9px;
    border-bottom:1px solid #e5e5e5;
    font-size:18px;
    line-height:30px;
    color:#58585a;
    font-weight:700;
    margin:40px 0 10px;
}

h3 {
    margin-bottom:3px;
    font-size:14px;
    line-height:20px;
    color:#58585a;
    font-weight:700;
}

h4 {
    font-size:12px;
    font-weight:700;
    color:#58585a;
    line-height:20px;
}

ol {
    list-style:decimal;
    margin:0 0 20px 16px;
}

strong {
    color:#4a4a4a;
}

.subheading {
    margin-bottom:40px;
    font-size:16px;
    line-height:24px;
}

h1.small {
    font-size:26px;
    line-height:36px;
}

#container {
    width:960px;
    margin:0 auto;
    padding:0 0 40px;
}

pre {
    border-left:2px solid #00afd8;
    background:url(/assets/img/pre-bg.png);
    font-size:12px;
    line-height:20px;
    width:620px;
    overflow:auto;
    overflow-y:hidden;
    margin:0;
    padding:0;
}

code {
    display:block;
    margin:0 0 0 10px;
}

header{
    z-index:100;
    margin-bottom:-30px;
    width:100%;
    height:100px;
}

header h1{
    font-family: 'Springsteel Lig', arial, serif; 

}

h1#logo,#logo a {
    display:block;
    left:0;
    top:30px;
    text-indent:-99999px;
    width:193px;
    height:41px;
    margin:0;
}

/* Main Menu */

#mainMenu{
    height:50px;
    margin:0 0 15px 0px;
    background-color:#6a6a6a;
    -moz-border-radius:3px;
    -webkit-border-radius:3px;
}

#mainMenu ul{
    display:inline;
    -webkit-border-bottom-right-radius:2px;
    -webkit-border-bottom-left-radius:2px;
    -moz-border-radius-bottomright:2px;
    -moz-border-radius-bottomleft:2px;
}

#mainMenu ul li{
    margin-left:0px;
    width:120px;
    height:56px;
    display:inline;
    position:relative;
}


#mainMenu li a {
    float:left;
    display:block;
    text-decoration:none;
    width:120px;
    height:35px;
    font-size:13px;
    line-height:45px;
    text-align:center;
    color:#fff;
    text-transform:uppercase;
    padding-top:-4px;
    margin:0px;
}

#mainMenu li a:hover, #mainMenu li a:active{
    text-decoration:none;
    background-color:#7a7a7a;
    color:#fff;
    width:120px;
    height:50px;
   -webkit-border-top-left-radius:2px;
    -webkit-border-bottom-left-radius:2px;
    -moz-border-radius-topleft:2px;
    -moz-border-radius-topleft:2px;
}

#mainMenu .signup{
    background-color:#69c21c;
    height:50px;
    margin-left:360px;
   -webkit-border-top-right-radius:2px;
    -webkit-border-bottom-right-radius:2px;
    -moz-border-radius-topright:2px;
    -moz-border-radius-bottomright:2px;
}

#mainMenu .signup:hover{
    background-color:#00afd8;
}

/*mainMenu Sub Menu */

#mainMenu ul li ul{

    display:none;
    background-color:#7a7a7a;
}

#mainMenu ul li:hover ul{
    text-transform:none;
    display:block;
    position:absolute;
    width:115px;
    top:50px;
    right:-37px;
}

#mainMenu ul li:hover ul a{
    float:left;
    margin:0 0 0 -35px;
    line-height:35px;
    width:150px;
    height:35px;
    border:none;
    font-size:12px;
    text-align:left;
    text-transform:none;


}

#mainMenu  ul li ul li a:hover{    
    width:152px;
    height:30px;
    font-weight:bold;
    margin-left:-38px;
    line-height:35px;
}

footer{
    clear:both;
    border-top: 1px solid #d3d3d3;
    width:100%;
    height:50px;
}

#sales {
    width:160px;
    height:30px;
    float:right;
    margin-top:-140px;
    margin-right:215px;
}

/*Sales */
#sales p{    
    font-weight:bold;  
    text-align:center;
    line-height:45px;
}

/*Search Bpx */

#searchBox{

    float:right;
    margin-top:-125px;
}
#searchBoxForm{
    margin-top:10px;
}

#searchBoxForm .search {
    font-size: 11px;
    color: #fff;
    padding: 6px;
    border: 1px solid #b8b8b8;
    -moz-border-radius:2px; 
    border-radius:2px
}

#searchBoxForm .submit {
    background-color:#00afd8;
    width: 67px;
    height: 26px;
    border: none;
    color: #fff;
    cursor: pointer;
    -moz-border-radius:2px; 
    border-radius:2px
}
#searchBoxForm .submit:hover,
#searchBoxForm .submit.hover {
    background-color:#00afd8;
}


/* Billboard */

#billboard {
    min-height:240px;
    background:#00afd8;
    font-size:16px;
    line-height:24px;
    color:#fff;
    -webkit-border-top-left-radius:3px;
    -webkit-border-top-right-radius:3px;
    -moz-border-radius-topleft:3px;
    -moz-border-radius-topright:3px;
    padding:34px 520px 60px 40px;
}
#billboard h1 {
    font-family:arial;
    margin-bottom:20px;
    font-size:36px;
    line-height:40px;
    color:#fff;
}


#billboard a {
    color:#fff;
    text-decoration:underline;
}

#services {
    background-color:#fff;
    -webkit-border-bottom-right-radius:3px;
    -webkit-border-bottom-left-radius:3px;
    -moz-border-radius-bottomright:3px;
    -moz-border-radius-bottomleft:3px;
}

#services a{
    text-decoration:none;
}

#services h2 {
    position:relative;
    border:0;
    background:url(/assets/img/sections/home/services-icons.png) 0 0 no-repeat;
    margin:-40px 0 3px;
    padding:0;
}

#services h2 a {
    display:block;
    color:#58585a;
    padding:94px 0 0;
}

#services .service1 {
    padding-left:20px;
    border-left:0;
}

#services .service2 h2 {
    background-position:-168px 0;
}

#services .service3 h2 {
    background-position:-336px 0;
}

#services .service4 h2 {
    background-position:-504px 0;
}

#services .service5 h2 {
    background-position:-672px 0;
}

#services .service1,.service2,.service3,.service4,.service5{
    float:left;
    background-color:#fff;
    border-left:1px solid #e5e5e5;
    width:154px;
    height:100%;
    padding:0 18px 0 19px;
    margin-bottom:10px;

}

#services img{
    height:100px;
    width:100px;
    margin:0 auto;
}

#servicesBanner{
    clear:both;
    width:100%;
    height:90px;
    margin:15px 0 10px 0;
    min-height:100%;
    background-color:#e0e0e0;
}

#servicesBanner p{
    padding:35px 0 0 8px;
    font-size:18px;
    color:#ccc;
}

/*Nav Content */

.subNavHeading{
    color:#fff;
    padding-top:10px;
    margin:9px 0 15px 45px;
}

/*Inner Page CSS */

#innerPageLeftCol{
    float:right;
    width:220px;
    min-height:100%;
    margin:-10px 0 10px 0;
}

#innerPageContent{
    background-color:#fff;
    float:left;
    width:720px;
    min-height:100%;
    margin-bottom:10px;
    -webkit-border-bottom-right-radius:2px;
    -webkit-border-bottom-left-radius:2px;
    -moz-border-radius-bottomright:2px;
    -moz-border-radius-bottomleft:2px;
    -webkit-border-top-right-radius:2px;
    -webkit-border-top-left-radius:2px;
    -moz-border-radius-topright:2px;
    -moz-border-radius-topleft:2px;
}

.boxOne{
    background:url(../images/sidebarBox.png) no-repeat;
    width:220px;
    height:100%;
    min-height:100%;
    margin:10px 0 0 0;
    -webkit-border-bottom-right-radius:2px;
    -webkit-border-bottom-left-radius:2px;
    -moz-border-radius-bottomright:2px;
    -moz-border-radius-bottomleft:2px;
    -webkit-border-top-right-radius:2px;
    -webkit-border-top-left-radius:2px;
    -moz-border-radius-topright:2px;
    -moz-border-radius-topleft:2px;
}

.boxOne li{
    margin:5px 0 0 0;
    padding-top:5px;
}

.boxOne a{
    text-decoration: none;
    color:#00afd8;
}

.boxTwo{
    background-color:#fff;
    width:220px;
    height:125px;
    margin:15px 0 0 0;
    -webkit-border-bottom-right-radius:2px;
    -webkit-border-bottom-left-radius:2px;
    -moz-border-radius-bottomright:2px;
    -moz-border-radius-bottomleft:2px;
    -webkit-border-top-right-radius:2px;
    -webkit-border-top-left-radius:2px;
    -moz-border-radius-topright:2px;
    -moz-border-radius-topleft:2px;
}

.boxThree{
    background-color:#fff;
    width:220px;
    height:125px;
    margin:15px 0 5px 0;
    -webkit-border-bottom-right-radius:2px;
    -webkit-border-bottom-left-radius:2px;
    -moz-border-radius-bottomright:2px;
    -moz-border-radius-bottomleft:2px;
    -webkit-border-top-right-radius:2px;
    -webkit-border-top-left-radius:2px;
    -moz-border-radius-topright:2px;
    -moz-border-radius-topleft:2px;
}

#innerPageContent h1{
    margin:30px;
}

#innerPageContent .innerPageSubHeading{
    display:block;
    font-size:16px;
    margin:30px;
    width:450px;
}

#innerPage .separator{
    margin-top:20px;
    padding-top:20px;
}

#innerPageContent p{
    margin:30px;
}

#innerPageContent img{
    float:right;
    width:175px;
    height:175px;
    margin:30px;
    padding:3px;
}

/*Packages Template */

#packageContainer{
    width:320px;
    list-style:none;
    font-size:14px;
    color:#000;
    margin:0 auto;
}

#packageContainer .leftCol{
    width:35%;
    float:left;
    margin-bottom:10px;
}

#packageContainer .leftCol li{
    height:15px;
    border-bottom:1px solid #ccc;
    border-right:1px solid #ccc;
}

#packageContainer .rightCol{
    width:35%;
    float:left;
    margin-bottom:10px;
}
#packageContainer .rightCol li{
    height:15px;
    text-indent:8px;
    border-bottom:1px solid #ccc;
}

#packageContainer .orderButton{
    float:left;
    margin:0px 20px 20px 65px;
    background:#00afd8;
    font-family:Helvetica,arial,sans-serif;
    font-size:12px;
    color:#fff;
    -moz-border-radius:3px;
    -webkit-border-radius:3px;
    padding:6px 5px;
}

#innerPageProducts{
    clear:both;
    width:100%;
    height:90px;
    margin:10px 0 10px 0;
    min-height:100%;
    background-color:#e0e0e0;
}

#innerPageProducts p{
    padding:35px 0 0 8px;
    font-size:18px;
    color:#ccc;
}


/*Footer */
#nav-footer{
    margin: 20px 0 0 0;
    padding: 20px 0 20px 20px;
    border-top: 1px solid lightGrey;
    list-style: none;
    font-size: 11px;
}

#nav-footer #col{
        margin: 0 auto;
        display:inline-block;
        width:215px;
}

#nav-footer li{
    margin:10px 0 0 -10px;
    text-align:left;
}

#nav-footer li a{
    text-decoration:none;
}

#nav-footer ul{
    list-style:none;
}

#nav-footer .first{
    text-decoration:none;
    font-weight:bold;
    padding-left:30px;
}

我的菜单似乎在Chrome中对齐良好 < img src="https://i.sstatic.net/t02ik.png" alt="Chrome"> 但当我在 Firefox 5 中打开它时,我得到 this 为什么?

答案1:

我在另一台电脑上用firefox 3.6测试并得到: 在此处输入图像描述

HTML:

<nav id="mainMenu"> 

    <ul> 
    <li class="first"> 
        <a href="http://domain.co.nz/#">Domains</a> 
        <ul> 
            <li class="first"> 
                <a href="http://domain.co.nz/domains/transfer-my-domain">Transfer my Domain</a> 
            </li> 
            <li class="last"> 
                <a href="http://domain.co.nz/domains/get-a-domain-name">Get A Domain Name</a> 
            </li> 
        </ul> 
    </li> 
</ul> 
<ul> 
    <li class=""> 
        <a href="http://domain.co.nz/#">Hosting</a> 
        <ul> 
            <li class="first"> 
                <a href="http://domain.co.nz/hosting/website-hosting">Website Hosting</a> 
            </li> 
            <li class=""> 
                <a href="http://domain.co.nz/hosting/hosted-crm">Hosted CRM</a> 
            </li> 
            <li class="last"> 
                <a href="http://domain.co.nz/hosting/transfer-to-hostone">Transfer to HostOne</a> 
            </li> 
        </ul> 
    </li> 
</ul> 
<ul> 
    <li class="has_current"> 
        <a href="http://domain.co.nz/#">Email</a> 
        <ul> 
            <li class="first"> 
                <a href="http://domain.co.nz/email/personal-e-mail">Personal E-Mail</a> 
            </li> 
            <li class=""> 
                <a href="http://domain.co.nz/email/business-e">Business Email</a> 
            </li> 
            <li class="last current"> 
                <a href="http://domain.co.nz/email/microsoft-hosted-exchange">Microsoft Hosted Exchange</a> 
            </li> 
        </ul> 
    </li> 
</ul> 
<ul> 
    <li class=""> 
        <a href="http://domain.co.nz/support">Support</a> 
    </li> 
</ul> 
<ul> 
    <li class="signup last"> 
        <a href="http://domain.co.nz">SIGN UP</a> 
    </li> 
</ul> 

</nav><!-- Main Menu End --> 

CSS:

#mainMenu{
    height:50px;
    margin:0 0 15px 0px;
    background-color:#6a6a6a;
    -moz-border-radius:3px;
    -webkit-border-radius:3px;
}

#mainMenu ul{
    display:inline;
    -webkit-border-bottom-right-radius:2px;
    -webkit-border-bottom-left-radius:2px;
    -moz-border-radius-bottomright:2px;
    -moz-border-radius-bottomleft:2px;
}

#mainMenu ul li{
    margin-left:0px;
    width:120px;
    height:56px;
    display:inline;
    position:relative;
}


#mainMenu li a {
    float:left;
    display:block;
    text-decoration:none;
    width:120px;
    height:35px;
    font-size:13px;
    line-height:45px;
    text-align:center;
    color:#fff;
    text-transform:uppercase;
    padding-top:-4px;
    margin:0px;
}

#mainMenu li a:hover, #mainMenu li a:active{
    text-decoration:none;
    background-color:#7a7a7a;
    color:#fff;
    width:120px;
    height:50px;
   -webkit-border-top-left-radius:2px;
    -webkit-border-bottom-left-radius:2px;
    -moz-border-radius-topleft:2px;
    -moz-border-radius-topleft:2px;
}

#mainMenu .signup a{
    background-color:#69c21c;
    height:50px;
    margin-left:360px;
   -webkit-border-top-right-radius:2px;
    -webkit-border-bottom-right-radius:2px;
    -moz-border-radius-topright:2px;
    -moz-border-radius-bottomright:2px;
}

#mainMenu li .signup a:hover{
    background-color:#00afd8;
}

/*mainMenu Sub Menu */

#mainMenu ul li ul{

    display:none;
    background-color:#7a7a7a;
}

#mainMenu ul li:hover ul{
    text-transform:none;
    display:block;
    position:absolute;
    width:135px;
    top:50px;
    right:-55px;
}

#mainMenu ul li:hover ul a{
    float:left;
    margin:0 0 0 -35px;
    line-height:35px;
    width:150px;
    height:35px;
    border:none;
    font-size:12px;
    text-align:left;
    text-transform:none;


}

#mainMenu  ul li ul li a:hover{    
    width:170px;
    height:30px;
    font-weight:bold;
    margin-left:-35px;
    line-height:35px;
}

On further investigation I have discovered that there is something in my CSS that is making my navigation display funny -> Everything on my innerPage and HTML below (Main Page) load fine but I am still being driven crazy by the nav so I have uploaded my full html and css to resolve this issue,

HTML:

<div id="container"> 

<header> 
                <h1>company</h1> 
                <div id="logo"><a href="http://company.co.nz/">Home</a></div> 

<section id="sales"> 
        <p></p> 

</section> 

<section id="searchBox"> 

    <form id="searchBoxForm"> 
        <fieldset> 
                <input type="text" name="search" id="search" placeholder="Search Here" /> 
                <input class="submit" type="submit" name="submit" id="submit" value="Search" /> 
        </fieldset> 

    </form> 

</section> 

</header><!-- Header End --> 

<nav id="mainMenu"> 
        <ul> 
        <li><a href="#">Nav 1</a> 
        <ul><!--Sub Menu Hosting --> 
                <li><a href="#">Drop Down 1</a></li> 
        </ul><!-- Sub Menu Hosting Ends --> 
        </li> 
        <li><a href="#">Nav 2</a> 
        <ul><!-- Sub Menu Email --> 
                <li><a href="#">I want my own email</a></li> 
        </ul><!-- Sub Menu Email Ends --> 
        </li> 
        <li><a href="#">Nav 3</a> 
        <ul><!-- Sub Menu Support --> 
                <li><a href="#">Need Support?</a></li> 
                </ul><!-- Sub Menu Support Ends --> 
        </li> 
        <li><a href="#">Nav 3</a> 
        <ul><!-- Sub Menu About --> 
                <li><a href="#">About</a></li> 
        </ul><!-- Sub Menu About Ends --> 
        </li> 
        <li><a class="signup" href="#">SIGN UP</a></li> 
        </ul> 
</nav><!-- Main Menu End --> 

<div id="billboard"> 

    <h1 contenteditable="true">Cloud Hosting </h1> 

    <p>Hosting to take you way above the clouds</p> 

</div> 

<article id="services"> 

<section class="service1"> 
        <h2><a href="#">Plan 1</a></h2> 
        <p>Cloud hosting isn't difficult or expensive. OnApp lets hosts deploy clouds in a day, at very low cost.</p> 
        <p><a href="#" class="bullet">More</a></p> 
</section> 

<section class="service2"> 
        <h2><a href="#">Plan 2</a></h2> 
        <p>OnApp maximizes margins with high density, self-organizing clouds and an intuitive control panel.</p> 
        <p><a href="#" class="bullet">More</a></p> 

</section> 

<section class="service3"> 
        <h2><a href="#">Plan 3</a></h2> 
        <p>No more late-night fixes in the data center. OnApp has automatic failover and multi-layered security. </p> 
        <p><a href="#" class="bullet">More</a></p> 
</section> 

<section class="service4"> 
        <h2><a href="#">MS Exchange</a></h2> 
        <p>OnApp's fine control of permissions, limits and pricing lets you tailor the customer experience.</p> 
        <p><a href="#" class="bullet">More</a></p> 

</section> 

<section class="service5"> 
        <h2><a href="#">Domains</a></h2> 
        <p>OnApp's fine control of permissions, limits and pricing lets you tailor the customer experience.</p> 
        <p><a href="#" class="bullet">More</a></p> 
</section> 

</article><!-- Services End --> 

<div id="servicesBanner"> 
    <p>Services: </p> 
</div> 
<ul id="nav-footer"> 
<div id="col">           
</div>
<p>©</p> 
</div> <!-- container --> 

        </body> 
</html>

CSS:

body {
    line-height:1;
    font:12px normal helvetica,arial,sans-serif;
    color:gray;
    background:url(includes/images/body-bg.png) 0 0 repeat-x #efefef;
}

ol,ul {
    list-style:none;
}

blockquote,q {
    quotes:none;
}

blockquote:before,blockquote:after,q:before,q:after {
    content:none;
}

h1 {
    margin-bottom:20px;
    font-size:36px;
    line-height:40px;
    color:#58585a;
    font-weight:700;
}

h2 {
    padding-bottom:9px;
    border-bottom:1px solid #e5e5e5;
    font-size:18px;
    line-height:30px;
    color:#58585a;
    font-weight:700;
    margin:40px 0 10px;
}

h3 {
    margin-bottom:3px;
    font-size:14px;
    line-height:20px;
    color:#58585a;
    font-weight:700;
}

h4 {
    font-size:12px;
    font-weight:700;
    color:#58585a;
    line-height:20px;
}

ol {
    list-style:decimal;
    margin:0 0 20px 16px;
}

strong {
    color:#4a4a4a;
}

.subheading {
    margin-bottom:40px;
    font-size:16px;
    line-height:24px;
}

h1.small {
    font-size:26px;
    line-height:36px;
}

#container {
    width:960px;
    margin:0 auto;
    padding:0 0 40px;
}

pre {
    border-left:2px solid #00afd8;
    background:url(/assets/img/pre-bg.png);
    font-size:12px;
    line-height:20px;
    width:620px;
    overflow:auto;
    overflow-y:hidden;
    margin:0;
    padding:0;
}

code {
    display:block;
    margin:0 0 0 10px;
}

header{
    z-index:100;
    margin-bottom:-30px;
    width:100%;
    height:100px;
}

header h1{
    font-family: 'Springsteel Lig', arial, serif; 

}

h1#logo,#logo a {
    display:block;
    left:0;
    top:30px;
    text-indent:-99999px;
    width:193px;
    height:41px;
    margin:0;
}

/* Main Menu */

#mainMenu{
    height:50px;
    margin:0 0 15px 0px;
    background-color:#6a6a6a;
    -moz-border-radius:3px;
    -webkit-border-radius:3px;
}

#mainMenu ul{
    display:inline;
    -webkit-border-bottom-right-radius:2px;
    -webkit-border-bottom-left-radius:2px;
    -moz-border-radius-bottomright:2px;
    -moz-border-radius-bottomleft:2px;
}

#mainMenu ul li{
    margin-left:0px;
    width:120px;
    height:56px;
    display:inline;
    position:relative;
}


#mainMenu li a {
    float:left;
    display:block;
    text-decoration:none;
    width:120px;
    height:35px;
    font-size:13px;
    line-height:45px;
    text-align:center;
    color:#fff;
    text-transform:uppercase;
    padding-top:-4px;
    margin:0px;
}

#mainMenu li a:hover, #mainMenu li a:active{
    text-decoration:none;
    background-color:#7a7a7a;
    color:#fff;
    width:120px;
    height:50px;
   -webkit-border-top-left-radius:2px;
    -webkit-border-bottom-left-radius:2px;
    -moz-border-radius-topleft:2px;
    -moz-border-radius-topleft:2px;
}

#mainMenu .signup{
    background-color:#69c21c;
    height:50px;
    margin-left:360px;
   -webkit-border-top-right-radius:2px;
    -webkit-border-bottom-right-radius:2px;
    -moz-border-radius-topright:2px;
    -moz-border-radius-bottomright:2px;
}

#mainMenu .signup:hover{
    background-color:#00afd8;
}

/*mainMenu Sub Menu */

#mainMenu ul li ul{

    display:none;
    background-color:#7a7a7a;
}

#mainMenu ul li:hover ul{
    text-transform:none;
    display:block;
    position:absolute;
    width:115px;
    top:50px;
    right:-37px;
}

#mainMenu ul li:hover ul a{
    float:left;
    margin:0 0 0 -35px;
    line-height:35px;
    width:150px;
    height:35px;
    border:none;
    font-size:12px;
    text-align:left;
    text-transform:none;


}

#mainMenu  ul li ul li a:hover{    
    width:152px;
    height:30px;
    font-weight:bold;
    margin-left:-38px;
    line-height:35px;
}

footer{
    clear:both;
    border-top: 1px solid #d3d3d3;
    width:100%;
    height:50px;
}

#sales {
    width:160px;
    height:30px;
    float:right;
    margin-top:-140px;
    margin-right:215px;
}

/*Sales */
#sales p{    
    font-weight:bold;  
    text-align:center;
    line-height:45px;
}

/*Search Bpx */

#searchBox{

    float:right;
    margin-top:-125px;
}
#searchBoxForm{
    margin-top:10px;
}

#searchBoxForm .search {
    font-size: 11px;
    color: #fff;
    padding: 6px;
    border: 1px solid #b8b8b8;
    -moz-border-radius:2px; 
    border-radius:2px
}

#searchBoxForm .submit {
    background-color:#00afd8;
    width: 67px;
    height: 26px;
    border: none;
    color: #fff;
    cursor: pointer;
    -moz-border-radius:2px; 
    border-radius:2px
}
#searchBoxForm .submit:hover,
#searchBoxForm .submit.hover {
    background-color:#00afd8;
}


/* Billboard */

#billboard {
    min-height:240px;
    background:#00afd8;
    font-size:16px;
    line-height:24px;
    color:#fff;
    -webkit-border-top-left-radius:3px;
    -webkit-border-top-right-radius:3px;
    -moz-border-radius-topleft:3px;
    -moz-border-radius-topright:3px;
    padding:34px 520px 60px 40px;
}
#billboard h1 {
    font-family:arial;
    margin-bottom:20px;
    font-size:36px;
    line-height:40px;
    color:#fff;
}


#billboard a {
    color:#fff;
    text-decoration:underline;
}

#services {
    background-color:#fff;
    -webkit-border-bottom-right-radius:3px;
    -webkit-border-bottom-left-radius:3px;
    -moz-border-radius-bottomright:3px;
    -moz-border-radius-bottomleft:3px;
}

#services a{
    text-decoration:none;
}

#services h2 {
    position:relative;
    border:0;
    background:url(/assets/img/sections/home/services-icons.png) 0 0 no-repeat;
    margin:-40px 0 3px;
    padding:0;
}

#services h2 a {
    display:block;
    color:#58585a;
    padding:94px 0 0;
}

#services .service1 {
    padding-left:20px;
    border-left:0;
}

#services .service2 h2 {
    background-position:-168px 0;
}

#services .service3 h2 {
    background-position:-336px 0;
}

#services .service4 h2 {
    background-position:-504px 0;
}

#services .service5 h2 {
    background-position:-672px 0;
}

#services .service1,.service2,.service3,.service4,.service5{
    float:left;
    background-color:#fff;
    border-left:1px solid #e5e5e5;
    width:154px;
    height:100%;
    padding:0 18px 0 19px;
    margin-bottom:10px;

}

#services img{
    height:100px;
    width:100px;
    margin:0 auto;
}

#servicesBanner{
    clear:both;
    width:100%;
    height:90px;
    margin:15px 0 10px 0;
    min-height:100%;
    background-color:#e0e0e0;
}

#servicesBanner p{
    padding:35px 0 0 8px;
    font-size:18px;
    color:#ccc;
}

/*Nav Content */

.subNavHeading{
    color:#fff;
    padding-top:10px;
    margin:9px 0 15px 45px;
}

/*Inner Page CSS */

#innerPageLeftCol{
    float:right;
    width:220px;
    min-height:100%;
    margin:-10px 0 10px 0;
}

#innerPageContent{
    background-color:#fff;
    float:left;
    width:720px;
    min-height:100%;
    margin-bottom:10px;
    -webkit-border-bottom-right-radius:2px;
    -webkit-border-bottom-left-radius:2px;
    -moz-border-radius-bottomright:2px;
    -moz-border-radius-bottomleft:2px;
    -webkit-border-top-right-radius:2px;
    -webkit-border-top-left-radius:2px;
    -moz-border-radius-topright:2px;
    -moz-border-radius-topleft:2px;
}

.boxOne{
    background:url(../images/sidebarBox.png) no-repeat;
    width:220px;
    height:100%;
    min-height:100%;
    margin:10px 0 0 0;
    -webkit-border-bottom-right-radius:2px;
    -webkit-border-bottom-left-radius:2px;
    -moz-border-radius-bottomright:2px;
    -moz-border-radius-bottomleft:2px;
    -webkit-border-top-right-radius:2px;
    -webkit-border-top-left-radius:2px;
    -moz-border-radius-topright:2px;
    -moz-border-radius-topleft:2px;
}

.boxOne li{
    margin:5px 0 0 0;
    padding-top:5px;
}

.boxOne a{
    text-decoration: none;
    color:#00afd8;
}

.boxTwo{
    background-color:#fff;
    width:220px;
    height:125px;
    margin:15px 0 0 0;
    -webkit-border-bottom-right-radius:2px;
    -webkit-border-bottom-left-radius:2px;
    -moz-border-radius-bottomright:2px;
    -moz-border-radius-bottomleft:2px;
    -webkit-border-top-right-radius:2px;
    -webkit-border-top-left-radius:2px;
    -moz-border-radius-topright:2px;
    -moz-border-radius-topleft:2px;
}

.boxThree{
    background-color:#fff;
    width:220px;
    height:125px;
    margin:15px 0 5px 0;
    -webkit-border-bottom-right-radius:2px;
    -webkit-border-bottom-left-radius:2px;
    -moz-border-radius-bottomright:2px;
    -moz-border-radius-bottomleft:2px;
    -webkit-border-top-right-radius:2px;
    -webkit-border-top-left-radius:2px;
    -moz-border-radius-topright:2px;
    -moz-border-radius-topleft:2px;
}

#innerPageContent h1{
    margin:30px;
}

#innerPageContent .innerPageSubHeading{
    display:block;
    font-size:16px;
    margin:30px;
    width:450px;
}

#innerPage .separator{
    margin-top:20px;
    padding-top:20px;
}

#innerPageContent p{
    margin:30px;
}

#innerPageContent img{
    float:right;
    width:175px;
    height:175px;
    margin:30px;
    padding:3px;
}

/*Packages Template */

#packageContainer{
    width:320px;
    list-style:none;
    font-size:14px;
    color:#000;
    margin:0 auto;
}

#packageContainer .leftCol{
    width:35%;
    float:left;
    margin-bottom:10px;
}

#packageContainer .leftCol li{
    height:15px;
    border-bottom:1px solid #ccc;
    border-right:1px solid #ccc;
}

#packageContainer .rightCol{
    width:35%;
    float:left;
    margin-bottom:10px;
}
#packageContainer .rightCol li{
    height:15px;
    text-indent:8px;
    border-bottom:1px solid #ccc;
}

#packageContainer .orderButton{
    float:left;
    margin:0px 20px 20px 65px;
    background:#00afd8;
    font-family:Helvetica,arial,sans-serif;
    font-size:12px;
    color:#fff;
    -moz-border-radius:3px;
    -webkit-border-radius:3px;
    padding:6px 5px;
}

#innerPageProducts{
    clear:both;
    width:100%;
    height:90px;
    margin:10px 0 10px 0;
    min-height:100%;
    background-color:#e0e0e0;
}

#innerPageProducts p{
    padding:35px 0 0 8px;
    font-size:18px;
    color:#ccc;
}


/*Footer */
#nav-footer{
    margin: 20px 0 0 0;
    padding: 20px 0 20px 20px;
    border-top: 1px solid lightGrey;
    list-style: none;
    font-size: 11px;
}

#nav-footer #col{
        margin: 0 auto;
        display:inline-block;
        width:215px;
}

#nav-footer li{
    margin:10px 0 0 -10px;
    text-align:left;
}

#nav-footer li a{
    text-decoration:none;
}

#nav-footer ul{
    list-style:none;
}

#nav-footer .first{
    text-decoration:none;
    font-weight:bold;
    padding-left:30px;
}

My menu seems to align fine in Chrome Chrome but when I open it in Firefox 5 I get this why?

Answer 1:

I have tested on another computer in firefox 3.6 and get:
enter image description here

HTML:

<nav id="mainMenu"> 

    <ul> 
    <li class="first"> 
        <a href="http://domain.co.nz/#">Domains</a> 
        <ul> 
            <li class="first"> 
                <a href="http://domain.co.nz/domains/transfer-my-domain">Transfer my Domain</a> 
            </li> 
            <li class="last"> 
                <a href="http://domain.co.nz/domains/get-a-domain-name">Get A Domain Name</a> 
            </li> 
        </ul> 
    </li> 
</ul> 
<ul> 
    <li class=""> 
        <a href="http://domain.co.nz/#">Hosting</a> 
        <ul> 
            <li class="first"> 
                <a href="http://domain.co.nz/hosting/website-hosting">Website Hosting</a> 
            </li> 
            <li class=""> 
                <a href="http://domain.co.nz/hosting/hosted-crm">Hosted CRM</a> 
            </li> 
            <li class="last"> 
                <a href="http://domain.co.nz/hosting/transfer-to-hostone">Transfer to HostOne</a> 
            </li> 
        </ul> 
    </li> 
</ul> 
<ul> 
    <li class="has_current"> 
        <a href="http://domain.co.nz/#">Email</a> 
        <ul> 
            <li class="first"> 
                <a href="http://domain.co.nz/email/personal-e-mail">Personal E-Mail</a> 
            </li> 
            <li class=""> 
                <a href="http://domain.co.nz/email/business-e">Business Email</a> 
            </li> 
            <li class="last current"> 
                <a href="http://domain.co.nz/email/microsoft-hosted-exchange">Microsoft Hosted Exchange</a> 
            </li> 
        </ul> 
    </li> 
</ul> 
<ul> 
    <li class=""> 
        <a href="http://domain.co.nz/support">Support</a> 
    </li> 
</ul> 
<ul> 
    <li class="signup last"> 
        <a href="http://domain.co.nz">SIGN UP</a> 
    </li> 
</ul> 

</nav><!-- Main Menu End --> 

CSS:

#mainMenu{
    height:50px;
    margin:0 0 15px 0px;
    background-color:#6a6a6a;
    -moz-border-radius:3px;
    -webkit-border-radius:3px;
}

#mainMenu ul{
    display:inline;
    -webkit-border-bottom-right-radius:2px;
    -webkit-border-bottom-left-radius:2px;
    -moz-border-radius-bottomright:2px;
    -moz-border-radius-bottomleft:2px;
}

#mainMenu ul li{
    margin-left:0px;
    width:120px;
    height:56px;
    display:inline;
    position:relative;
}


#mainMenu li a {
    float:left;
    display:block;
    text-decoration:none;
    width:120px;
    height:35px;
    font-size:13px;
    line-height:45px;
    text-align:center;
    color:#fff;
    text-transform:uppercase;
    padding-top:-4px;
    margin:0px;
}

#mainMenu li a:hover, #mainMenu li a:active{
    text-decoration:none;
    background-color:#7a7a7a;
    color:#fff;
    width:120px;
    height:50px;
   -webkit-border-top-left-radius:2px;
    -webkit-border-bottom-left-radius:2px;
    -moz-border-radius-topleft:2px;
    -moz-border-radius-topleft:2px;
}

#mainMenu .signup a{
    background-color:#69c21c;
    height:50px;
    margin-left:360px;
   -webkit-border-top-right-radius:2px;
    -webkit-border-bottom-right-radius:2px;
    -moz-border-radius-topright:2px;
    -moz-border-radius-bottomright:2px;
}

#mainMenu li .signup a:hover{
    background-color:#00afd8;
}

/*mainMenu Sub Menu */

#mainMenu ul li ul{

    display:none;
    background-color:#7a7a7a;
}

#mainMenu ul li:hover ul{
    text-transform:none;
    display:block;
    position:absolute;
    width:135px;
    top:50px;
    right:-55px;
}

#mainMenu ul li:hover ul a{
    float:left;
    margin:0 0 0 -35px;
    line-height:35px;
    width:150px;
    height:35px;
    border:none;
    font-size:12px;
    text-align:left;
    text-transform:none;


}

#mainMenu  ul li ul li a:hover{    
    width:170px;
    height:30px;
    font-weight:bold;
    margin-left:-35px;
    line-height:35px;
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

相守太难 2024-11-26 18:30:59

好吧,我没有确切地看到你所看到的,但我确实看到 FF 中有点混乱。我对你的几个 CSS 语句做了一些更改,它在 Chrome 和 FF 中工作。这是我所做的:

  1. 更改了“#mainMenu ul li”删除了“display:inline;”添加了“浮动:左;列表样式:无;”

    #mainMenu ul li
    {
        左边距:0px;
        宽度:120px;
        高度:56px;            
        职位:亲属;
        浮动:向左;
        列表样式:无;
    }
    
  2. 添加了“#mainMenu .signup”和“float: right;”

    #mainMenu .signup
    {
        浮动:右;
    }
    
  3. 删除了“margin-left: 360px;”来自“#mainMenu .signup a”

    #mainMenu .signup a
    {
        背景颜色:#69c21c;
        高度:50px;
       -webkit-边框-右上半径:2px;
       -webkit-border-bottom-right-radius:2px;
       -moz-边框-半径-topright:2px;
       -moz-边框-半径-bottomright:2px;
    }
    

现在,由于我在导航栏中使用了浮动,您可能需要在结束导航标记后放置一个清晰的 div,以清除浮动并正常启动一个新的 div。

<div style="clear: both;"> </div>

OK, I didn't see exactly what you were seeing, but I did see that it was a bit messed up in FF. I made some changes to a couple of your CSS statements, and it was working in Chrome and FF. Here is what I did:

  1. Changed "#mainMenu ul li" removed "display: inline;" added "float: left; list-style: none;"

    #mainMenu ul li
    {
        margin-left:0px;
        width:120px;
        height:56px;            
        position:relative;
        float: left;
        list-style: none;
    }
    
  2. Added "#mainMenu .signup" with a "float: right;"

    #mainMenu .signup
    {
        float: right;
    }
    
  3. Removed "margin-left: 360px;" from "#mainMenu .signup a"

    #mainMenu .signup a
    {
        background-color:#69c21c;
        height:50px;
       -webkit-border-top-right-radius:2px;
       -webkit-border-bottom-right-radius:2px;
       -moz-border-radius-topright:2px;
       -moz-border-radius-bottomright:2px;
    }
    

Now since I am using floats in your nav bar you will probably want to put a clear div after the closing nav tag to clear the floats and start a new div normally.

<div style="clear: both;"> </div>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文