Despite the image why the container or vertical height not increasing

Link

Despite the image why the container or vertical height not increasing for the HTML that I have shown. I have also set margin auto?

Where am I going wrong?

It will not center until it reaches its max-width, though a table display would.

Could you elaborate what is not inceasing height by its content?

According to image height the size should increase.

Despite the fact that I am taking this div out of the header it is getting into the header.

Just for practice I am trying to replicate something like this →

It did, until I saw your site wanted me to allow javascript, when I did it display the issue. :wink:

Not increasing see here:

That doctor guy image is overflowing.

I think I should change the css from float to flex. Float is a disaster.

Sorry, could have been my browser just being nice. :smiley:

I see the issue now, and javascript is disabled again. Is that the only issue?

Could be. :wink:

But here; just add overflow:hidden to the .top div that contains the float.

Or you could use some other clear floats method.

Yes, Now it works. We have to also use float clear anywhere?

Only when you want the container, parent or adjacent, be aware of the float.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.