The width and height of the div in the body are set to 100%, and the div is not displayed.
朝花夕逝
朝花夕逝 2017-11-30 21:30:40
0
1
1169
<!Doctype html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>test</title>
		<style>
			*{margin:0;padding:0;}
			body{background: green;}
			#main{width:100%;
				height:100%;
				background: yellow;
				margin-top:50px;
				}
		</style>
	</head>
	
	<body>
		<div id="main">
		</div>
	</body>

</html>

After adding the header declaration <!Doctype html>, the div cannot be displayed. After removing it, it can be displayed normally. The same situation occurs when tested in IE11 and chrome browsers. What is the problem?

朝花夕逝
朝花夕逝

reply all(1)
猪哥

You can see it by adding a border to main

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template