1 reply [Last post]
thme
thme's picture
Offline
newbie
Last seen: 3 years 5 weeks ago
Timezone: GMT+2
Joined: 2011-10-23
Posts: 1
Points: 2

how can i get my divs to stretch with my content. i have tried min-height (number of pixels)px; but it didnt seem to work how can i make this work guys.

http://game4vids.com/Browse_call_of_duty_modern_warefare_2.php

//mod edit: Moved to a more appropriate forum. Site checks is for completed site/page critiques. Fixed link. ~gt

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 11 hours 23 min ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9263
Points: 3269

Remove the height property

Remove the height property completely. The element will conform to its contents' height. That leads to other problems with the floats. See Inline=block galleries.

For a simple solution that works with what you've got, set the height to about 230px, and cut the top and bottom margins to about 6px. The inline-block method will make centering much simpler.

cheers,

gary

UI design should be egoless; if you succumb to the temptation to show off, you’re probably doing it wrong. (from ESR)

There are enough html & css demos and tutorials to be interesting. Please visit.