Please do not vote to close. This is about the technical reason on why this is not working. I already have a working solution and I'm not asking for it.
Simple example where I need to make .wrapper
height, at least, the browser height.
The following works in IE10-11, Edge, Firefox, Chrome (working fiddle):
<!doctype html>
<html lang="it">
<head >
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Demo</title>
<style>
body {
margin: 0;
height: 100vh;
background-color: red;
}
.wrapper {
min-height: 100%;
background-color: green;
}
</style>
</head>
<body>
<div class="wrapper"></div>
</body>
</html>
But if I set body
to min-height
instead of height
(which is, IMHO, reasonable), it doesn't work anymore (not working fiddle). Why? What's the technical reason behind it?
EDIT 1
Another working fiddle where body
has min-height: 100vh
and .wrapper
has min-height: inherit
.
Another working fiddle where only .wrapper
has min-height: 100vh
.