HTML布局

HTML布局:

1、使用<div>布局:

例如:

<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <title>HTML布局</title>
  <style>
  body{
  margin:0px;
  }
  #container{
  width:100%;
height:500px;
background-color:#F0F8FF;
 }
#heading{
  width:100%;
height:10%;
background-color:#90EE90;
 }
 #content-menu{
  width:30%;
height:80%;
background-color:#ADD8E6;
float:left;
 }
 #content-body{
 width:70%;
height:80%;
background-color:#FAF0E6;
float:left;
 }
 #footing{
width:100%;
height:20%;
background-color:#FFDEAD;
 }
   </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>

效果:
在这里插入图片描述

2、使用<table>布局:

例如:

<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <title>table布局</title>
  <style>
  body{
  margin:0px;
  }
    </style>
 </head>
 <body >
 <table width=600px height=300px style="background-color:#FFEFD5" cellspacing=0px>
 <tr>
  <td colspan="3" width="100%" height="10%" style="background-color:#DCDCDC">
  </td>
 </tr>
  <tr>
  <td width="20%" height="80%" style="background-color:#808080">
     <ul  style="background-color:white" >
    <li >我的主页</li>
    <li >博客管理</li>
    <li >文章管理</li>
    <li>评论管理</li>
   </ul>
  </td>
   <td width="60%" height="80%" style="background-color:white"></td>
  <td width="20%" height="80%" style="background-color:#808080"></td>
 </tr>
 <tr>
  <td colspan="3" width="100%" height="10%" style="background-color:#DCDCDC"></td>
 </tr>
 </table>
 </body>
</html>

效果:
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值