您的位置:首页 > Web前端

[Web前端技术教学]网页布局-基础布局练习-带框的界面铺满整个浏览器

2016-12-08 21:49 841 查看

练习目标:

带 黑框 的 绿色 界面 铺满 整个浏览器,并随着浏览器的 伸缩 而伸缩.

代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>基础大布局</title>
<style type="text/css">
<!--
html {
height:100%;
}
body {
margin: 0px;
height:100%;
}
#father{
background-color: #00FF00;
height:100%;
border-left: 10px solid #FF0000;
border-right: 10px solid #FF0000;
position: relative;
}
#text{
border-top: 10px solid #FF0000;
height:100%;
}
#bottomBorder {
height:10px;
background-color: #FF0000;
position: absolute;
width: 100%;
left: 0px;
bottom: 0px;
}
-->
</style>
</head>
<body>
<div id="father">
<div id="text"></div>
<div id="bottomBorder"></div>
</div>
</body>
</html>

效果图:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: