经典布局案例(一):

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>CSS布局</title>
</head>
<body style="margin: 0">
<div style=" width: 200px;height:500px;float: left"></div>

<div style="height: 300px;overflow: hidden"></div>

<div style="height: 200px;clear: both"></div>
</body>
</html>

 上述代码定义了三个div块,用到了float浮动属性、overflow属性和clear属性;(注意:具有float属性的div块的位置会影响页面显示效果)

页面效果如下:

 

Html 经典布局(一)

 其中红色div块为定宽绿色和蓝色不定宽。

转载自本人ITeye链接:http://xiaozhuang0706.iteye.com/blog/2262196

相关文章:

  • 2022-01-21
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2021-06-16
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-25
  • 2021-06-21
  • 2021-09-27
  • 2022-02-28
  • 2021-11-18
  • 2021-07-21
  • 2021-09-30
相关资源
相似解决方案