SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Feb 2004
    Location
    Slovenia
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    2 columns fixed layout - question?

    I have 2 columns fixed layout with 3 IDs (container, nav, content):
    Code:
    #container {width: 750px;}
    #nav {float: left; width: 200px; background: #ccc;}
    now my question. What's the difference between:
    Code:
    #content {float: left; width: 550px;}
    or
    Code:
    #content {margin-left: 200px}

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

    In a fixed width container then basically theres no difference as they will both occupy the same space However the double float method will defeat ie's 3 pixel jog without the need for hacking.

    The following content (if any) will need to clear the floats of course, but you'd have to do that for both versions anyway.

    In a fluid width container then the right float would drop down and slide under the first float at smaller screen sizes etc.

    So your answer is no real difference in your example

    Paul

  3. #3
    SitePoint Member
    Join Date
    Feb 2004
    Location
    Slovenia
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So in fixed width is better to use 2 floats because of IE 3px jog.
    Thanks!

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


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
  •