Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8886565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:35:19+00:00 2026-06-14T21:35:19+00:00

My CSS is: #menu { background-color: #a40a0a; width: 830px; height: 36px; position: relative; top:

  • 0

My CSS is:

#menu {
    background-color: #a40a0a;
    width: 830px;
    height: 36px;
    position: relative;
    top: 39px;
    left: 172px;
}
#menu >ul {
    list-style-type: none;
}
#menu ul li {
    font-family: Arial, Helvatica, Verdana;
}
#menu ul li >a {
    display: block;
    float: left;
    text-decoration: none;
    color: #ffffff;
    line-height: 36px;
    width: 166px;
    text-align: center;
}
#menu ul li >a:hover {
    background-color: #d74343;
    border-bottom: 2px solid #bc1515;
    line-height: 34px;
}
#menu ul li >a:active {
    background-color: #a40a0a;
}

This menu does not look right ie7 and belows. If this is wrong, please tell me the right, thanks.

http://jsfiddle.net/a4Qe3/ here is the link

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:35:21+00:00Added an answer on June 14, 2026 at 9:35 pm

    You need to put float on the li instead of the a. This is bacause the li will block each time.

    Here is the the updated code:

    CSS

    #menu {
        background-color: #a40a0a;
        width: 830px;
        height: 36px;
        position: relative;
        top: 39px;
        left: 172px;
    }
    #menu > ul {
        list-style-type: none;
    }
    #menu ul li {
        font-family: Arial, Helvatica, Verdana;
        float: left;
    }
    #menu ul li > a {
        display: block;
        text-decoration: none;
        color: #ffffff;
        line-height: 36px;
        width: 166px;
        text-align: center;
    }
    #menu ul li > a:hover {
        background-color: #d74343;
        border-bottom: 2px solid #bc1515;
        line-height: 34px;
    }
    #menu ul li > a:active {
        background-color: #a40a0a;
    }
    

    Demo

    Edit 1

    We put the float on the li instead of the a because each a is wrapped in a li which has display: block; applied to each. If you think of the DOM structure, if you float the a tags you are floating items next to each other, that are not in the same scope. They are not DOM siblings. Their parents are. So you are just leaving their parents hanging around. Now in IE7, if you float after a blocking element, that floated item will be pushed down, as was happening in your case. So what we should do is float the li items.

    Here is a demo where the a tags are floated, and I have put a border around the li tags to show what is going on. Check it in IE7.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to center a CSS menu that has an unknown width. I found
I have a menu setup with the below css: a.menu:active { color: #000000; }
I found a way to change the background color of a menu option upon
Here's the site: http://breteastman.com/stormwater-basics/ Here's the dropdown css & menu CSS. #menu-main-menu{margin-left:-30px;} #menu-main-menu a:hover
I have a horizontal CSS menu. The problem is when the user creates more
I am making a css menu. For this I am using a ul .
We need a database driven CSS menu . How would you do that? I
I'm trying to create a css menu bar that has all grey text with
I'm trying to implement a CSS menu and am having a problem with the
I am trying to create a css menu. I would like to remove border

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.