html 中div布局的简单使用

 时间:2026-02-15 00:57:27

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教程:怎么自定义形状
  • 奇偶校验码怎么算
  • 热门搜索
    菲诗小铺的东西怎么样 怎么穿鞋带 照片大小怎么调整 胃息肉是怎么回事 开心用英语怎么说 婴儿黄疸高怎么办 考不上大学怎么办 眼球突出怎么恢复 命令提示符怎么打开 斜率怎么求