www.webdeveloper.com
Results 1 to 3 of 3

Thread: Height of the box not right

  1. #1
    Join Date
    Jun 2005
    Posts
    201

    Height of the box not right

    Hello there. When I try to make the height of the #main_area CSS attribute of this page: http://www.barkleigh.com/test%20webs...ore_index.html
    It doesn't work when I set it to auto, or 100%, it just gets smaller and stays at the top of the page. Thanks

  2. #2
    Join Date
    Mar 2006
    Location
    Newcastle NSW Australia
    Posts
    4,033
    Make the following change to your css
    Code:
    #main_area{
    	background-color:#E4F0DB;
    	margin-left:auto;
    	margin-right:auto;
    	width:710px;
    	overflow:hidden;
    }
    The div will not normally "surround" the contents when the contents are floated, as floating an element takes it out of the document flow. The floats need to be "cleared", either by an additional object at the end of the content with clear:both set, or by using the overflow property on the container as above.

    Cheers
    Graeme

  3. #3
    Join Date
    Jun 2005
    Posts
    201
    Hello there. It works perfectly in Firefox, IE6, and Safari. It now doesn't center correctly on the page in IE5.2 for mac, but I may be able to fix that and if not, that browser is dated anyway. Thanks.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles