代码如下:
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>@_@</title>
<style>
* {
margin: 0;
padding: 0;
}
color {
width: 100%;
height: 100%;
background-color: #f69;
}
</style>
</head>
<body>
<div id="color">
<p>你好</p>
</div>
</body>
</html>
只有横向的撑满了屏幕,如何使纵向也撑满屏幕?设置了height:100%不管用,在body中设置background-color不是我要的结果。
1 answers
id为color的div的父元素没有撑满,body和html都要100%
html,body{ height: 100%; width: 100%;}
Hot tools Tags
Hot Questions
Popular tool
vc9-vc14 (32+64 bit) runtime library collection (link below)
Download the collection of runtime libraries required for phpStudy installation
VC9 32-bit
VC9 32-bit phpstudy integrated installation environment runtime library
PHP programmer toolbox full version
Programmer Toolbox v1.0 PHP Integrated Environment
VC11 32-bit
VC11 32-bit phpstudy integrated installation environment runtime library
SublimeText3 Chinese version
Chinese version, very easy to use
Hot Topics
20417
7
13577
4






