• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

My Monkey Do

A Log of Coding Solutions

  • Home
  • Web Hosts
  • Tools
  • About

Make outer div expand with inner div

January 4, 2012 by Webhead

Problem

I have two divs, one inside the other. I make the inner div have a height of 100px. The problem is that the outer div does not expand to 100px.  Instead it stays at 0px height.

Solution

In order for the outer div to expand with the inner div, you must have the following:

  1. Don’t state a height
  2. Enclose elements with Float
  3. Don’t use absolute positioning

source: http://forums.devshed.com/css-help-116/trying-to-make-div-expand-as-div-within-expands-508432.html
keywords: css expand outer div

Filed Under: Coding Tagged With: css

Primary Sidebar

Topics

apache apple block editor chrome cms css debug eCommerce embed firebug firefox git gmail goDaddy google hosting htaccess html html 5 IE crap image iPad iPhone javascript jquery linux localization mac os x ms sql mysql open source optimize php php 5.3 responsive rest api seo svg tinymce woocommerce wordpress wpengine xss yii youtube




Categories

  • Coding
  • Off the Shelf
  • Plugins
  • Random Thoughts
  • Server Stuff
  • Tools