html 中div布局的简单使用

 时间:2026-04-22 04:51:50

1、观察图片构成。总共十一个板块。首先要有一个大的div包含所有,背景色等。

html 中div布局的简单使用

2、.background{

background-color: #008000;

height: 800px;

width: 420px;

margin: 0 auto;

}

html 中div布局的简单使用

3、.a1{

height: 80px;

width: 200px;

background: #fff;

margin-left: 50px;

margin-top: 10px;

margin-right: 10px;

float: left;

html 中div布局的简单使用

4、.a2{height: 80px;

  width: 100px;

  background-color: #fff;

  margin-top: 10px;

  float: left;

  }

.a3{

height: 80px;

width: 310px;

background-color: #FFFFFF;

margin-left: 50px;

margin-top: 10px;

float: left;

}

.a4{

height: 80px;

width: 310px;

background-color: #FFFFFF;

margin-left: 50px;

float: left;

margin-top: 10px;

html 中div布局的简单使用

5、.a5{

height: 80px;

width: 150px;

background: #fff;

margin-left: 50px;

margin-top: 10px;

margin-right: 10px;

float: left;

}

.a6{height: 80px;

  width: 150px;

  background-color: #fff;

  margin-top: 10px;

  float: left;

  }

.a7{height: 50px;

  width: 310px;

  background-color: #fff;

  margin-top: 10px;

  margin-left: 50px;

  float: left;

  } 

.a8{

height: 80px;

width: 150px;

background: #fff;

margin-left: 50px;

margin-top: 10px;

margin-right: 10px;

float: left;

}

html 中div布局的简单使用

6、.a9{height: 80px;

  width: 150px;

  background-color: #fff;

  margin-top: 10px;

  float: left;

  }

.a10{height: 80px;

  width: 310px;

  background-color: #fff;

  margin-top: 10px;

  float: left;

  margin-left: 50px;

  } 

.a11{height: 80px;

  width: 310px;

  background-color: #fff;

  margin-top: 10px;

  float: left;

  margin-left: 50px;

  margin-bottom: 10px;

  } 

</style>

html 中div布局的简单使用

7、</head>

<body>

<div >

<div class="background">

  <div class="a1">1</div>

  <div class="a2">2</div>

  <div class="a3">3</div>

  <div class="a4">4</div>

  <div class="a5">5</div>

  <div class="a6"> 6</div>

  <div class="a7">7</div>

  <div class="a8">8</div>

  <div class="a9">9</div>

  <div class="a10">10</div>

  <div class="a11">11</div>

   </div>

</div>

</body>

</html>

  • PHP教程 使用定界符定义字符串
  • div+css如何控制背景图片全显示出来?
  • 网站导航栏如何设置二级页面到下拉菜单中
  • Axure RP教程:怎么自定义形状
  • 奇偶校验码怎么算
  • 热门搜索
    涤棉是什么面料 什么是数轴 agree是什么意思 滚床单是什么意思 虚拟机是什么 hct是什么意思 落枕了什么办法最有效 什么叫窦性心律 mouse是什么意思 4月1日是什么节日啊