kensbeijing Posted September 28, 2009 Share Posted September 28, 2009 When I have a larger parent div, and put a smaller div inside (but give it a float:left), the parent div doesn't change size with the smaller div.<div id="parent"><div id="child" style="float: left;"></div></div>How do I make div parent get bigger as child gets bigger (to hold it in)? Link to comment Share on other sites More sharing options...
dsonesuk Posted September 28, 2009 Share Posted September 28, 2009 give the parent div a style of display:inline-block; Link to comment Share on other sites More sharing options...
kensbeijing Posted September 28, 2009 Author Share Posted September 28, 2009 give the parent div a style of display:inline-block;oh thanks man, I never understood what these display blocks and inlines are. Link to comment Share on other sites More sharing options...
thescientist Posted September 28, 2009 Share Posted September 28, 2009 elements in a webpage are classified as either being inline or block level elements. For instance, div's, headers, paragraphs are considered block level elements. Where as anchor tags, images, and span tags would be considered inline elements. Link to comment Share on other sites More sharing options...
dsonesuk Posted September 28, 2009 Share Posted September 28, 2009 I think you will find that a img is a inline element and not a block element Link to comment Share on other sites More sharing options...
thescientist Posted September 28, 2009 Share Posted September 28, 2009 i figured i would probably get one of those wrong... :)fixed it so I don't supply the wrong information. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.