html让高度充满浏览器
大家讲道理
大家讲道理 2016-11-08 15:00:36
0
1
1042

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


大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

répondre à tous(1)
代言

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

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


Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!