通过学习div的布局,以一个简单的内容管理网站的布局为例子,用div+css进行简单的网页布局,加深学印象:

<html>
<head>
<title>CSS+div布局学习</title>
<style type="text/css">
body{margin:0;padding:0;text-align:center}
.head{height:230px;width:960px;background:#f96;margin:0 auto}
.cat{height:30px;width:960px;background:#f80;margin:3 auto}
.content{height:806px;width:960px;background:#fff;margin:3 auto}
.content_left{height:800px;width:760px;background:#fff;float:left}
.leftone{height:250px;width:760px;background:#666;}
.lefttwo{height:300px;width:760px;background:#fff; margin:3 0 0 0}
.leftthree{height:250px;width:760px;background:#999; margin:3 0 0 0}
.content_right{height:806px;width:197px;background:#00f;float:right;margin:0 0 0 3}
.lefttwo_l{height:300px;width:360px;background:#cc3;float:left}
.lefttwo_r{height:300px;width:397px; background:#cc9;float:right;margin:0 0 0 3}
.footer{height:30px;width:960px;background:#f80;margin:3 auto}
</style>
</head>
<body>
<div class="head">logo位960*230</div><!--头部logo-->
<div class="cat">导航栏位置960*30</div><!--导航栏-->
<div class="content">
<div class="content_left"><!--内容左侧-->
<div class="leftone">左侧第一栏760*250</div><!--左侧第一栏-->
<div class="lefttwo"><!--左侧第二栏-->
<div class="lefttwo_l">左侧第二栏左360*300</div><!--左侧第二栏的左侧-->
<div class="lefttwo_r">左侧第二栏右197*300</div><!--左侧第二栏右侧-->
</div>
<div class="leftthree">左侧第三栏760*250</div><!--左侧第三栏-->
</div>
<div class="content_right">
右侧内容位197*806
</div><!--内容右侧-->
</div><!--内容-->
<div class="footer">底部位置960*30</div>
</body>
</html>

效果如下:

最新文章

  1. Notification中使用Glide
  2. 【SQL语句】 - Ctrl+3 查询表属性的存储过程
  3. RouterOS软路由设置固定IP+PPPOE
  4. 处理一则MySQL Slave环境出现ERROR 1201 (HY000): Could not initialize master info structure的案例
  5. IOS 开发 【os x 使用常识】
  6. FIR滤波器设计
  7. FastRPC 3.2 发布,高性能 C++ 协程 RPC 框架
  8. GROUPING SETS、ROLLUP、CUBE
  9. Javascript多线程引擎(四)
  10. 【转载】CSRF攻击及其应对之道
  11. docker-swarm建立本地集成开发环境
  12. 【Zookeeper系列】ZooKeeper伸缩性(转)
  13. 设置Tomcat管理员用户名和密码
  14. #define宏重定义
  15. hdu 4864 任务分配贪心
  16. Eclipse中执行Maven命令时控制台输出乱码
  17. Linux系统下搭建FTP/SFTP服务器
  18. Rotation and Transform
  19. Python创建ES索引
  20. xml简单介绍及libmxml编程

热门文章

  1. NOI2018D2T1 屠龙勇士
  2. 扩展KMP的应用
  3. taskkill帮助信息
  4. AJPFX解析Java关键字之assert
  5. .NET 几种数据绑定控件的区别
  6. ASP.NET Excel下载方法一览
  7. Win10浏览器Spartan无法全屏
  8. xamarin 学习笔记01-环境配置
  9. C++ 继承/派生、访问属性、构造函数
  10. VUE scoped css 局部css内嵌样式方法 &gt;&gt;&gt;