Results 1 to 6 of 6
  1. #1

    Adjustable height using CSS?

    Hello, I have a friend helping me with a CSS design but it takes him about a week to make one simple change so I would like to fix this one thing myself. I once asked him now to make a div height variable so the more text/data is in the area it automatically moves the other divs around it to the next line. He fixed it but I do not want to bother him again so I would like to know how to do this. Could you please give me a working example of code so that if there are added rows it would push the div content below it to the next line instead of overlapping each other. I can set a manual height: 150px and it works but if there is no text on that section it just displays a big empty space which is why I want a variable height. I tried searching all over google and cannot find that. Thanks
    Last edited by lexington; 09-06-2008 at 12:52 PM.

  2. #2
    Join Date
    Jan 2008
    Location
    St. John's, NL
    Posts
    2,082
    Usually height:auto will take care of this. Take a look at a site I put together recently, premiumdjs dot com, and see how it is done there. Hope it helps
    Cpanel/WHM PHP Perl Ruby Full Time Support
    LCWSoft - Canada web hosting (based in Newfoundland) since 2007
    Servers based in the US and Canada (Uptime Report)

  3. #3
    Yeah I tried that before creating this topic but it didn't work.

  4. #4
    Join Date
    Jan 2008
    Location
    St. John's, NL
    Posts
    2,082
    Did you try using position: on your divs?
    Cpanel/WHM PHP Perl Ruby Full Time Support
    LCWSoft - Canada web hosting (based in Newfoundland) since 2007
    Servers based in the US and Canada (Uptime Report)

  5. #5
    Join Date
    Aug 2005
    Location
    Barcelona, Spain
    Posts
    3,371
    just remove the height, there's no need to add it, unless you want a specific height. Adjustable height is actually the default setting. If it doesn't work, there's other CSS probably interfering. Do you have a live example?
    hi there!

  6. #6
    Thanks for the help guys but I just used php to detect how many characters are on the page and to insert the height div based on the results and that does the trick for now.

Posting Permissions

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