SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Huh? What now? tntcheats's Avatar
    Join Date
    Aug 2003
    Location
    BC, Canada
    Posts
    719
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    2 Column CSS problems with clearing...

    Hey, I've created a layout which makes use of floats to make 2 columns.
    Left one's fixed width, right one fills up the rest of the space.

    The problem is that I want to have, in the right column, images which are aligned to the left of text in their own border-surrounded divs. But in order to do this I've tried using floats; however, I don't know how to make it so that the div ends after the image--I'd clear:both but that makes it so that whatever's clearing, and whatever follows it, will show up after the entirety of the left column.

    Any help would be appreciated.

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

    I'm not quite sure if I understand what you want but it sounds like you want to use clear:both on an element in the right column without it clearing the left column also.

    If so then the solution is to place a wapper inside the right column that is 100% wide and is itself floated. This wrapper will hold all the content for the right side and any floats inside the wrapper can be cleared as normal because the clearing is constrained to the floated container as it will be unable to clear itself (so to speak).

    If thats not what you meant then you may need to show an example

  3. #3
    Huh? What now? tntcheats's Avatar
    Join Date
    Aug 2003
    Location
    BC, Canada
    Posts
    719
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Haha sorry for not explaining myself clearer--but it sounds like you've understood me and explained it a bit better than I did, using a substantially smaller amount of words.

    Thanks a lot, Paul. You're the man.


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
  •