SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard
    Join Date
    Apr 2002
    Posts
    2,293
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    stop 2nd floated column collapsing

    i've got two columns of text each in a div. both divs have { float:left; width:33em; }. works fine apart from when the window's width is decrease the 2nd column on the right jumps down and goes underneath the first -- how should two columns be done to avoid that?

    the page in question is here: http://www.hdbatik.co.uk/ogtemp20060.../sponsors.html

    thanks.

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's how floats are supposed to behave, and that's the reason for using floats in the first place.

    If you'd rather get a horizontal scrollbar instead, you must make sure that the element containing those floats is always more than 66em wide.
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Wizard
    Join Date
    Apr 2002
    Posts
    2,293
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    > That's how floats are supposed to behave, and that's the reason for using floats in the first place.

    i see. should i not be using floats at all to get a column layout like that maybe then? if so, what's the alternative?

    > If you'd rather get a horizontal scrollbar instead, you must make sure that the element containing those floats is always more than 66em wide.

    ok right -- thanks. i'll give that a go

  4. #4
    SitePoint Wizard
    Join Date
    Apr 2002
    Posts
    2,293
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    yes, width:67em in body makes the 2nd column not colapse when the window is reduced in width -- thanks v. much


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
  •