I made a webpage with the following code and viewed it in Google Chrome.
<html>
<head>
<style type="text/css">
html {padding:30px; background-color:blue;}
body {margin:0px; background-color:red;}
</style>
</head>
<body>
hello world
</body>
</html>
The result is what I expected, a red square with a 30x blue border that fills the entire web browser window. However, when I view it in Firefox, the red box is only the height of one line. IE8 lacks a blue frame.
How to make Firefox and IE8 display the same as in Google Chrome?
Additional notes I tried to add different doctype tags to the page, but it only showed that it looks like Firefox, that is, 1 line-height of red.
source
share