Skip navigation
Currently Being Moderated

Setting the height attribute to an id doesn't work

Jul 10, 2012 7:37 AM

Tags: #cs5 #help #error #auto #adobe #dreamweaver #css #height #editable_attributes

Can anyone help me with this I have set up a page with  <div id="content-body"> filled with all the content and I want this to have an auto height on it as there is re sizable functions on the page. But when I set the height to auto the height is only about 5 pixels high and doesn't seem to take any notice of the content. I can't for the life of me work out why and any help will be much appreciated.

 

The web page in question is http://www.flitecarz.co.uk/leaflet-flyer-printing.html

 
Replies
  • Currently Being Moderated
    Jul 10, 2012 10:05 AM   in reply to NessaFrankling

    No need to set the height of a <div> to auto just let the content fill it.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 10, 2012 3:26 PM   in reply to NessaFrankling

    NessaFrankling wrote:

     

    Can anyone help me with this I have set up a page with  <div id="content-body"> filled with all the content

    Actually, it's not filled with content. Both the rightbar and Main-Middle divs are floated inside your content-body div. When elements are floated, they're removed from the normal flow of the document. As a result, content-body has no height.

     

    Remove the height property from the #content-body style rule, and add overflow: hidden:. Adding the overflow property will make the div stretch to accommodate the floated divs.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points