找回密码
 立即注册

day2-4,清除浮动-额外标签法 [复制链接]

admin 2025-5-18 18:21:05 195
清除浮动-额外标签法
1.jpg

1.jpg
  1.   <title>清除浮动-额外标签法</title>
  2.   <style>
  3.     .father {
  4.       margin: 10px auto;
  5.       width: 1200px;
  6.       /* height: 300px; */
  7.       background-color: pink;
  8.     }
  9.     .left {
  10.       float: left;
  11.       width: 200px;
  12.       height: 300px;
  13.       background-color: skyblue;
  14.     }
  15.     .right {
  16.       float: right;
  17.       width: 950px;
  18.       height: 300px;
  19.       background-color: orange;
  20.     }
  21.     .bottom {
  22.       height: 100px;
  23.       background-color: brown;
  24.     }
  25.     .clearfix {
  26.       clear: both;
  27.     }
  28.   </style>
  29. </head>
  30. <body>
  31.   <div class="father">
  32.     <div class="left"></div>
  33.     <div class="right"></div>
  34.     <div class="clearfix"></div>
  35.   </div>
  36.   <div class="bottom"></div>
  37. </body>
复制代码
1.jpg


4.jpg

5.jpg

1.jpg
随机推荐

0 回复

发布新话题
搜索
返回顶部