Why does the html element not occupy the entire browser of the browser?

I am working on a site. Many people claim that the item htmlexpands to the entire viewport. When I do the code as follows:

<!doctype html>
<html>
<head>
<style>
html{
    border:1px solid red;
}
</style>

<meta charset="utf-8">
<title>Test</title>
</head>

<body>
Hi
</body>
</html>

The border is only displayed at the top of the screen saying "Hello." Does the htmldefault default for the entire screen in the browser match ?

+4
source share
2 answers

, , html CSS; - , . auto; auto spec, - , , , . body.

, html, "" , html . ( body html ); . :

, , , ..

html ?

quirks IE ( 6); - ( , CSS2, CSS ). html body 100% quirks, html body, , .

+5

. html body auto . -

html,body {
  height: 100%;
}

.

+1

Source: https://habr.com/ru/post/1540151/


All Articles