您好,登錄后才能下訂單哦!
一、使用<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>
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。