HTML5界面的相关基础布局:
1.界面布局
2.表格布局
下面给出相关代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>第四次,布局等学习</title>
<style type="text/css">
body{
margin: 0px;
}
div#container{
width: 100%;
height: 950px;
background-color: chartreuse;
}
div#heading{
width: 100%;
height: 10%;
background-color: red;
}
div#content_menu{
width: 50%;
height: 80%;
background-color: bisque;
float: left;
}
div#content_body{
width: 50%;
height: 80%;
background-color: darkblue;
float: right;
}
div#footing{
width: 100%;
height: 90%;
background-color: gold;
}
</style>
</head>
<body>
界面布局<br/>
<div id="container">
<div id="heading">头部</div>
<div id="content_menu">内容菜单</div>
<div id="content_body">内容主体</div>
<div id="footing">底部</div>
</div>
表格布局<br/>
<table width="100%" height="300px" border="1" style="background-color: black" >
<tr>
<td colspan="2" width="100%" height="100%" style="background-color: gold">头部</td>
</tr>
<tr >
<td style="background-color: darkblue" height="80%" width="30%">
<ul>哈哈</ul>
<ul>嘿嘿</ul>
<ul>嘻嘻</ul>
</td>
<td style="background-color: darkgoldenrod" height="80%" width="70%">
<ol>拉拉</ol>
<ol>颖颖</ol>
<ol>哦哦</ol>
</td>
</tr>
</table>
</body>
</html>
可以看出,界面布局通过定义id,来更改其属性,等相关的信息,例如宽度,高度,颜色等基础布局。在表格布局中,直接在表格相关标签里面直接定义即可;
后面会慢慢接触到一些比较复杂的相关布局,下面给出代码运行后的实际图:
显示如上,大家可以自己操作实现。