Chinaunix首页 | 论坛 | 博客
  • 博客访问: 322656
  • 博文数量: 69
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 759
  • 用 户 组: 普通用户
  • 注册时间: 2014-09-09 14:15
个人简介

〆 人生就是拼命地奔跑,和华丽的跌倒。 つ

文章分类

全部博文(69)

文章存档

2017年(2)

2016年(16)

2015年(21)

2014年(30)

分类: Html/Css

2016-04-26 08:58:52

Sublime编写源代码:

点击(此处)折叠或打开

  1. <!DOCTYPE html>
  2. <html lang="zh-cn">
  3. <head>
  4.    <meta charset="utf-8">
  5.    <title>float布局</title>
  6.    <link rel="stylesheet" type="text/css" href="../css/float2.css">
  7. </head>
  8. <body>
  9.     <div id="content">
  10.         <div id="head">
  11.             <div>1</div>
  12.             <div>2</div>
  13.             <div>3</div>
  14.             <div>4</div>
  15.             <div>5</div>
  16.         </div>
  17.         
  18.         <div class=clear""></div>
  19.         <div id="middle">

  20.             <div id="lside">
  21.                 <div class="lside1">6</div>
  22.                 <div class="lside2">
  23.                     <div class="lone">8</div>
  24.                     <div class="ltwo">9</div>
  25.                 </div>
  26.                 <div class="lside3">11</div>
  27.             </div>
  28.             <div id="rside">
  29.                 <div class="rone">7</div>
  30.                 <div class="rtwo">10</div>
  31.             </div>
  32.         </div>
  33.         
  34.         <div class=clear""></div>

  35.         <div id="foot">
  36.             <div>12footer</div>
  37.         </div>

  38.     </div>
  39. </body>
  40. </html>
写入css文件:

点击(此处)折叠或打开

  1. /*
  2. * @Author: IT - Pony
  3. * @Date: 2016-04-23 14:09:05
  4. * @Last Modified by: IT - Pony
  5. * @Last Modified time: 2016-04-23 14:55:24
  6. */
  7. @charset "utf-8";
  8. *{margin: 0;padding: 0;}

  9. #content{
  10.     margin: 0 auto;
  11.     width: 1010px;
  12.     height: 600px;
  13.     border: 1px solid black;
  14.     text-align: center;
  15. }

  16. #head div{
  17.     width: 200px;
  18.     height: 100px;
  19.     border: 1px solid red;
  20.     float: left;
  21. }

  22. #middle{
  23.     width: 1008px;
  24.     height: 400px;
  25.     border: 1px solid black;
  26.     float: left;
  27. }

  28. #lside{
  29.     width: 746px;
  30.     height: 400px;
  31.     border: 1px solid green;
  32.     float: left;
  33. }

  34. #rside{
  35.     width: 258px;
  36.     height: 400px;
  37.     border: 1px solid green;
  38.     float: left;
  39. }

  40. .lside1{
  41.     width: 744px;
  42.     height: 100px;
  43.     border: 1px solid green;
  44. }

  45. .lside2{
  46.     width: 744px;
  47.     height: 198px;
  48.     border: 1px solid green;
  49. }

  50. .lside3{
  51.     width: 744px;
  52.     height: 98px;
  53.     border: 1px solid green;
  54. }

  55. .lone{
  56.     width: 370px;
  57.     height: 198px;
  58.     border: 1px solid gray;
  59.     float: left;
  60. }

  61. .ltwo{
  62.     width: 370px;
  63.     height: 198px;
  64.     border: 1px solid gray;
  65.     float: left;
  66. }

  67. .rone{
  68.     width: 256px;
  69.     height: 198px;
  70.     border: 1px solid purple;
  71. }

  72. .rtwo{
  73.     width: 256px;
  74.     height: 198px;
  75.     border: 1px solid purple;
  76. }

  77. #foot div{
  78.     width: 1008px;
  79.     height: 96px;
  80.     border: 1px solid purple;
  81.     float: left;
  82. }

  83. .clear{
  84.     clear: both;
  85. }
运行结果:
阅读(1576) | 评论(0) | 转发(0) |
0

上一篇:必应页面

下一篇:BLOG页面

给主人留下些什么吧!~~