SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard mark_W's Avatar
    Join Date
    Mar 2004
    Location
    West Midlands, United Kingdom
    Posts
    2,631
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Trouble with aligning in IE

    I have been playing around with this layout!

    I have not done much in CSS and was wandering if someone could explain why its positioned where it should be in firefox but not in IE?

    Thanks

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,380
    Mentioned
    180 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    Ie has a double margin bug on the side of a float nearest the windows edge or its parent containers edge and the margin on that side gets doubled.

    The fix is to ad display-inline to the offending element and causes ie to render the correct margin (for some unaccountable reason).

    The display-inline is totally safe because floats are block level by default and cannot be changed by css. Therefore other browsers that understand the specs ignore the display:inline.

    Code:
    #contentbox1{
     background-image: url('http://www.protemplates.ws/blog/images/blog.gif');
     background-repeat: no-repeat;
     float: left;
     padding-left: 2px;
     width: 160px;
     height: 253px;
     color: #CCC;
     text-align: justify;
     font-family: verdana;
     font-size: 0.8em;
     margin-left: 10px;
     margin-right: 16px;
     display:inline;
    }
    Hope that helps.

    Paul

  3. #3
    SitePoint Wizard mark_W's Avatar
    Join Date
    Mar 2004
    Location
    West Midlands, United Kingdom
    Posts
    2,631
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Paul, Brilliantly put

    Makes sense now!

    Cheers!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •