Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2011
    Posts
    105
    Thanks
    12
    Thanked 1 Time in 1 Post

    How to make the wrapper stretch to the content?

    Say I had a background image which gives the impression of columns - and I put this on my #wrapper div... How can I make this #wrapper container stretch as I put content into my columns (which are inside the #wrapper)?

    Presently, I can only get it to stretch down by giving the #wrapper an exact height but this is not satisfactory, as text resizing causes it to look ugly when the background does not repeat. Logically, div containers should stretch according to the size of what's inside them (this happens correctly with tables) - so how come my #wrapper div background won't continue repeating as I add more content to the child columns?

    I have the background of the #wrapper set to repeat-y.

    Also - how can I make it so that both columns (left and right) stretch equally together as I add content to either? I can do this with tables but if I add content to one column, the contents of the other column appears in the middle instead of at the top.

    Sorry to bother you guys but I'm not sure how to phrase all that down into one sentence for Google.

    Also - is height:100% valid? Does that work in CSS?
    Last edited by Daniel_A_Varney; 07-10-2011 at 03:24 PM.

  • #2
    Regular Coder
    Join Date
    Jul 2011
    Posts
    105
    Thanks
    12
    Thanked 1 Time in 1 Post
    I got it!

    I floated lots of others things left and used relative positioning. Is that right? Why did I have to do this?
    Last edited by Daniel_A_Varney; 07-10-2011 at 05:35 PM.


  •  

    Posting Permissions

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