Html 经典布局(二)

经典布局案例(二):

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

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

    <div style="height: 300px; 200px;float: right"></div>

</div>

<div style="height: 150px;clear: both"></div>

</body>
</html>

  上述代码定义了五个div块,用到了float浮动属性、overflow属性和clear属性;其中用到了div块的嵌套。

页面效果如下:

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

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

原文地址:https://www.cnblogs.com/BHfeimao/p/6497039.html