search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

1 answers
Q&A html让高度充满浏览器
html让高度充满浏览器
大家讲道理 2016-11-08 15:00:36 Views 1141

0

代码如下:
<!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不是我要的结果。


Your Answer
submit

1 answers
0

id为color的div的父元素没有撑满,body和html都要100%

html,body{    height: 100%;    width: 100%;}


2016-11-08 15:00:56

submit

Popular tool

vc9-vc14 (32+64 bit) runtime library collection (link below)

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

VC9 32-bit phpstudy integrated installation environment runtime library

PHP programmer toolbox full version

PHP programmer toolbox full version

Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit

VC11 32-bit

VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use