一、使用<div>元素布局

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>div布局</title>
<style type="text/css">
body{
margin:0px;
}
#container{
width:100%;
height:950px;
background-color:darkgray;
}
#heading{
width:100%;
height:10%;
background-color:aqua;
}
#content_menu{
width:30%;
height:80%;
background-color:aquamarine;
float:left;
}
#content_body{
width:70%;
height:80%;
background-color:blueviolet;
float:left;
}
#footing{
width: 100%;
height: 10%;
background-color: black;
clear: both;
}
</style>
</head>
<body>
<div id="container">
<div id="heading">頭部</div>
<div id="content_menu">內容菜單</div>
<div id="content_body">內容主體</div>
<div id="footing">底部</div>
</div>
</body>
</html>二、使用<table>元素布局
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>table布局</title>
<style type="text/css">
body{
margin:0px;
}
#container{
width:100%;
height:950px;
background-color:darkgray;
}
#heading{
width:100%;
height:10%;
background-color:aqua;
}
#content_menu{
width:30%;
height:80%;
background-color:aquamarine;
float:left;
}
#content_body{
width:70%;
height:80%;
background-color:blueviolet;
float:left;
}
#footing{
width: 100%;
height: 10%;
background-color: black;
clear: both;
}
</style>
</head>
<body>
<table width="100%" height="950px" >
<tr>
<td colspan="2" width="100%" height="10%" >這是頭部</td>
</tr>
<tr>
<td width="30%" height="80%" >左菜單</td>
<td width="70%" height="80%" >主體</td>
</tr>
<tr>
<td width="100%" height="10%" colspan="2" >這是底部</td>
</tr>
</table>
</body>
</html>另外有需要云服務器可以了解下創新互聯scvps.cn,海內外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業上云的綜合解決方案,具有“安全穩定、簡單易用、服務可用性高、性價比高”等特點與優勢,專為企業上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。
網站標題:HTML布局-創新互聯
當前路徑:http://www.yijiale78.com/article18/dgsigp.html
成都網站建設公司_創新互聯,為您提供營銷型網站建設、標簽優化、手機網站建設、網站建設、ChatGPT、品牌網站設計
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯