I have a question about the height of the body in the iframe .
body
is a block-level element,so if I don't set the height and nothing in body,the height of body is 0;
Now, I find that, when body in iframe, it's height is always the same as iframe.(if iframe has it's own height)
for example:
a html file , iframe is empty, it's height is 500px
.
body in the iframe is empty too, it's height is 500px
too.
why body is empty but it's height is the same as iframe?
I see Quirks Mode
in some blogs,but It will appear in html5
with <!DOCTYPE html>
?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
*{
margin:0;
padding:0;
}
iframe{
width:500px;
height:500px;
}
</style>
</head>
<body>
<iframe src="" frameborder="0"></iframe>
</body>
<script>
</script>
</html>