一个简单的网站布局(div+CSS)

   
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>页面布局</title>
</head>
 <style type="text/css">
    body,h1{margin:0; padding:0;color:#fff;text-align:center;}
    .top{margin:0 auto;background-color:#fff;width:90%;height:100px;}
    .logo{float:left;background-color:rgb(255,174,201);height:100px;width:20%;}
    .header{float:right;background-color:rgb(255,174,225);height:100px;width:80%;}
    .nav{margin:0 auto;background-color:rgb(254,234,107);height:100px;width:90%;}
    .main{margin:0 auto;background-color:rgb(236,147,204);height:600px;width:90%;}
    .main1{float:left;background-color:rgb(134,204,145);height:600px;width:33%;}
    .main2{float:left;background-color:rgb(104,214,145);height:600px;width:33%;}
    .main3{float:right;background-color:rgb(64,224,145);height:600px;width:34%;}
    .footer{margin:0 auto;background-color:rgb(206,107,214);height:100px;width:90%;}
 </style>
<body>
   <!--头部  -->
     <div class="top">
     <div class="logo"><h1>logo</h1></div>
     <div class="header"><h1>头部信息</h1></div>
     </div>
   <!--导航  -->
    <div class="nav"><h1>导航信息</h1></div>
   <!-- 主体部分 -->
    <div class="main">
       <div class="main1"><h1>主体信息1</h1></div>
        <div class="main2"><h1>主体信息2</h1></div>
        <div class="main3"><h1>主体信息3</h1></div>
   </div>
      <!-- 底部 -->
   <div class="footer"><h1>底部信息</h1></div>
</body>
</html>

二: 运行结果:


  • 10
    点赞
  • 52
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值