tmyonline Posted September 20, 2009 Share Posted September 20, 2009 Hi guys, Firefox seems to have a bug with the <div> tag. Whenever using <div> tag in Firefox, I'm forced to specify the height of the <div>, otherwise, it won't work. Often, I don't know in advance as to how much content will be dumped into the <div>. Therefore, it's not desirable to specify the div height. Is there a way to style the <div> tag so that it automatically expands or contracts depending on the amount of content it holds at the time ? ( I know the <table> tag would do it but the <table> tag takes a long time to load, especially when it contains images. ) Any idea ? Thanks a lot. Quote Link to comment https://forums.phpfreaks.com/topic/174864-problem-with-the-height-attribute-in-tag/ Share on other sites More sharing options...
haku Posted September 20, 2009 Share Posted September 20, 2009 You don't have to do anything - div tags by default in all browsers automatically adjust their height to the content, unless you have manually set them to not do so. Quote Link to comment https://forums.phpfreaks.com/topic/174864-problem-with-the-height-attribute-in-tag/#findComment-921730 Share on other sites More sharing options...
tmyonline Posted September 20, 2009 Author Share Posted September 20, 2009 Thanks a lot haku. It helped. Quote Link to comment https://forums.phpfreaks.com/topic/174864-problem-with-the-height-attribute-in-tag/#findComment-921949 Share on other sites More sharing options...
sticks464 Posted September 21, 2009 Share Posted September 21, 2009 As haku said, div's will expand with content unless it is floated content. Floated content need to be cleared to push the div down. Quote Link to comment https://forums.phpfreaks.com/topic/174864-problem-with-the-height-attribute-in-tag/#findComment-922038 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.