Possible to float two columns and no banner?

Discussion in 'HTML & Website Design' started by Mitchell, Jul 16, 2009.

  1. #1
    I am fairly new at this. I am creating a liquid layout.

    I am trying to float three columns side by side at the top of my web page. There is no banner. The left column and right column are images of fixed width.

    I have a minimum and maximum width to the body tag of this web page. So I want the center text to be able to expand and contract between the images to accommodate for different browser window sizes.

    I have used float left, float right. After several hours, I can't get this to work. Is it even possible?

    Thanks for any advise.
     
    Mitchell, Jul 16, 2009 IP
  2. agilius

    agilius Well-Known Member

    Messages:
    1,021
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    100
    #2
    It should be possible without problems.

    Let's say you have leftImage div, cernerContent div, and rightImage div. Simply float all to the left. It should do the trick for you.

    See my little example here:

    
    <style>
    
       #leftImage, #centerContent, #rightImage {float:left;}
    
    </style>
    <div id='leftImage'>
    </div>
    <div id='centerContent'>
    </div>
    <div id='rightImage'>
    </div>
    
    <!-- a br if you have a footer and want it to stay where it should stay -->
    <br clear='all'/>
    
    
    Code (markup):
    Watch out if you happen to have a parent div for these 3 divs. If you do, make sure you have a max and min width for him also.

    Did it help?
     
    agilius, Jul 16, 2009 IP
  3. Mitchell

    Mitchell Peon

    Messages:
    204
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for your reply.

    Since I posted this question I removed a couple of elements at the bottom of my page and I got pleasing results. That was apparently the problem, but I still have much to learn.

    I will study your example and try some more experiments.

    Thanks again.
     
    Mitchell, Jul 17, 2009 IP