Saurav Srivastava Saurav Srivastava - 1 year ago 30
CSS Question

Getting different output on Chrome and Firefox when setting height in percentage

I'm giving height in %. It gives output as expected on Chrome but not on Firefox.
I'm new in front-end development. Any help will be appreciated. Thanks in advance.

Answer Source

Hi @Saurav the height in percentage does not work properly every time. It will work fine if your parent have fix height (either in px, pt, view port unit).

Its better to use view port for height. If you are not aware of it, read the following article.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download