Help with floating boxes in Internet Explorer

Discussion in 'CSS' started by Jboo, Jun 9, 2008.

  1. #1
    Hi, I have some pictures that I need to float next to each other. I can't change the html as it's a database CMS but can alter the CSS. The pictures look fine in Firefox (pictures next to each other in a row) but in I.E the pictures get pushed down as the row of pictures goes on.

    This is my html:

    <div class="content"><div class="item-list"><ul><li>friends<div class="item-list"><ul><li><div class="picture"><a href="/people/test/6"><img src="images/default-avatar.gif"  /></a></div></li><li><div class="picture"><a href="/people/tee/4"><img src="picture-4.gif" /></a></div></li></ul></div></li></ul></div></div>
    
    </div>
    HTML:
    and my CSS:

    #user-profile #profile-relationships ul {
    	list-style:none;
    	padding:0;
    	margin:0;
    }
    
    #user-profile #profile-relationships ul li {
    	list-style:none;
    	padding:0;
    	margin:0;
    }
    
    #user-profile #profile-relationships .item-list .picture img {
    	width:30px;
    	float:left;
    }
    Code (markup):
    If anyone can point out how to fix this I'd greatly appreciate it.

    Thanks
     
    Jboo, Jun 9, 2008 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    That is some ugly html. :)

    Float the <li> instead of the image.

    cheers,

    gary
     
    kk5st, Jun 9, 2008 IP
  3. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #3
    or set the li to display:inline - just add that and the 'staircase' effect should dissapear.

    oh, and since you have list-style:none on the ul, you don't need to say it on the li.
     
    deathshadow, Jun 9, 2008 IP
  4. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #4
    ^ I would. I've already seen two pages where someone has list-style: none on a ul and IE ignored it, as if having that on the ul wasn't good enough for it or something. Esp if there are other, earlier menus with list-style images. Dunno why. One of my "resets" is
    ul, li {
    list-style: none;
    }
    to stop IE from maybe some day out of the blue being a bitch.
     
    Stomme poes, Jun 10, 2008 IP
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #5
    Only a problem in quirks mode... and then only in IE 6. (5.x doesn't do this) - I know, I've seen it too.
     
    deathshadow, Jun 11, 2008 IP
    Jboo likes this.
  6. Jboo

    Jboo Active Member

    Messages:
    229
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #6
    Thanks for all your help. It sure is some ugly html, but it's a CMS that's hard to change (although I've been trying for days!). I'll give your suggestions a go, thanks.
     
    Jboo, Jun 12, 2008 IP