<div>布局 和<table>布局

<div>布局

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>div布局</title>
    <link rel="stylesheet" type="text/css" href="buju.css">
</head>
<body>
<div id="container">
    <div id="heading">头部</div>
    <div id="menu">内容菜单</div>
    <div id="body">内容主体</div>
    <div id="foot">内容底部</div>
</div>

</body>
</html>
body{
    margin: 0px;
}
#container{
    width: 100%;
    height: 950px;
    background-color: darkcyan;
}
#heading{
    width: 100%;
    height: 10%;
    background-color: #d46bff;
}#menu{
    width: 30%;
    height: 80%;
    background-color: antiquewhite;
    float: left;
 }
 #body{
     width: 70%;
     height: 80%;
     background-color: aquamarine;
     float: right;
 }
 #foot{
     width: 100%;
     height: 10%;
     background-color: darkcyan;
     clear: both;
 }

body{
margin:0px;

}去除边框

<table>布局

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>tatble布局</title>
</head>
<body marginheight="0px" marginwidth="0px">
<table width="100%" height="950px" style="background-color: bisque ">
    <tr>
        <td colspan="3" width="100%" height="10%" style="background-color: brown">头部</td>
    </tr>
    <tr>
        <td width="20%" height="80%" style="background-color: aquamarine">左菜单</td>
        <td width="60%" height="80%" style="background-color: black">右菜单</td>
        <td width="20%" height="80%" style="background-color: black">菜单</td>

    </tr>
    <tr>
        <td width="100%" height="10%" colspan="3" style="background-color: darkorange">底部</td>
    </tr>
</table>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/wangqd97/article/details/81206582