1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Menu list and IE7

Discussion in 'CSS' started by Ludus, Dec 12, 2008.

  1. #1
    As per following image, I have a problem with a menu list:

    [​IMG]

    CSS for menu list:

    #sidebar ul {
        list-style-type: none;
        margin: 0 ;
        padding: 0;
    }
    
    #sidebar ul li {
        margin: 0 !important;
    	margin: 0 0 20px 0;
    	padding: 0;
        height:27px;
    	width: 210px;
        line-height:1.5em;
    	background:url(img/sidebarli.png) no-repeat;
    }
    
    #sidebar ul li a {
        margin: 0 !important;
    	margin: 0 0 0 0;
        color: #C64F27;
        text-decoration: none;
    	font-weight: bold;
    	font-size: 15px;
        padding: 0 0 0 10px;
        display:block;
    }
    
    #sidebar ul li a:hover {
        color:#C64F27;
    	margin: 0 !important;
    	margin: 0 0 0 0;
        text-decoration: underline;
    }
    
    #sidebar ul ul {
        list-style-type: none;
        margin: 0 ;
        padding: 0;
    }
    
    #sidebar ul ul li {
        height:5px;
    	width: 210px;
    	margin: -4px 0 0 0;
    	padding: 0;
    	background:url(img/sidebarbottom.png) no-repeat;
    }
    Code (markup):
    As you can see, the list items show a 2px white space at the bottom, and the ul li li items a bigger space.

    If I change the value on margin, nothing changes...
     
    Ludus, Dec 12, 2008 IP
  2. katendarcy

    katendarcy Peon

    Messages:
    115
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hard to know exactly what's going on without the HTML too, but have you tried "float:left;width:100%;" on the <li> tags?
     
    katendarcy, Dec 19, 2008 IP
  3. abcdefGARY

    abcdefGARY Well-Known Member

    Messages:
    665
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    110
    #3
    In IE, you need to specify a fixed width for:

    #sidebar ul li a {
         width: (how ever big it is);
    }
    Code (markup):
    that's all.
     
    abcdefGARY, Dec 19, 2008 IP
    Ludus likes this.
  4. Ludus

    Ludus Active Member

    Messages:
    105
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    95
    #4
    Thanks a lot, it works good. :)
     
    Ludus, Dec 22, 2008 IP