2 replies [Last post]
Ranju
Ranju's picture
Offline
newbie
Last seen: 7 years 38 weeks ago
Timezone: GMT+1
Joined: 2013-01-24
Posts: 3
Points: 5

Hello everyone,

My problem is that I have a parent div with two floating divs inside.I want parent divs hight to adjust according to the container div's height.but i have noticed that the container divs height reduces to zero while the floating divs are displayed as required .This causes a problem when i am trying to make a responsive website as the height and width of child are not getting adjusted with resolution change

I have tried the following things but without proper result
1)set parent's height and width to 100%
2)set parent's overflow:hidden
3)clearing floats of the parent

please help as I cannot understand the reason behind this

Thanks and Regards
Ranju

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 21 hours 26 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9772
Points: 3854

Containing float elements

See Enclosing float elements.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

Ranju
Ranju's picture
Offline
newbie
Last seen: 7 years 38 weeks ago
Timezone: GMT+1
Joined: 2013-01-24
Posts: 3
Points: 5

Problem Solved

Hello Gary,

Thank you for this useful link.It solved my problem by giving display:table Smile

Thanks and Regards
Ranju