TomR
TomR

Reputation: 3056

Does height CSS attribute (100%, 100vh) have some meaning for <html> or <body> tags?

I am experimenting with html/body/div nested structures to achieve complex layout in which browser scrollbars are prevented and only inner components (e.g. datagrids) can have some inner scrollbars. For this I have question - does height CSS attribute have some meaning for html and body tags? I am not talking about HTML height attribute (there is no such HTML attribute for html or body), but I mean CSS style attribute.

Upvotes: 0

Views: 140

Answers (1)

Aonghas M
Aonghas M

Reputation: 2101

Yes it has meaning for them. <html> and <body> are valid html elements and they can be styled by your CSS. The body and html element do not necessarily start at 100% height although some browsers might add some CSS to the elements to start with.

All DOM elements can be styled although some may behave differently.

Upvotes: 1

Related Questions