0

I understand the meaning of height given in percentage, but usually percentage is seen in relation to a parent element. So setting the height of a div element inside the body to 50% will make it 50% of the height of the body. But what is the parent of the html? Or how can one interpret the height of the html element in css?

What would for example happen if we set html { height: 50% ;}?

  • Does the accepted answer here help? https://stackoverflow.com/questions/31893330/html-and-body-elements-height – A Haworth May 29 '23 at 16:50

1 Answers1

0

The html height: 100% Makes that html component, have the same height as the parent an fill all the height of the component. However the padding of the parent componend could reduce it.