css中如何让一个div满屏显示

html-css020

css中如何让一个div满屏显示,第1张

<div style="position:absoluteleft:0top:0width:100%height:100%background-color:#bbc">这个div会满屏显示</div>

right是无法只适应填满剩余的高度和宽度的,必须设定right的高度,让right的高度大于left的的高度。

<style>

#main{

width:100%

height:60px

float:left

background:#0F0

}

#left{

height:50px

width:200px

background:#90F

float:left

}

#right{

width:100%

background:#FF0

height:200px

}

</style>

</head>

<body>

<div id="main"></div>

<div id="left">222222222222</div>

<div id="right">11111111111111</div>

</body>

</html>

<html>

<head>

<meta http-equiv="X-UA-Compatible" content="IE=Edge" />

<meta http-equiv="content-type" content="text/htmlcharset=utf-8" />

<title>div铺满屏</title>

</head>

<body>

<div style="border:solid 1px redwidth:100%height:100%">

</div>

</body>

</html>