| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- <style>
- .box{
- border: 3px solid black;
- /* height: 200px; */
- }
- .item{
- width: 200px;
- height: 200px;
- background-color: red;
- float: left;
- }
- .box2{
- height: 300px;
- width: 300px;
- background-color: blue;
- }
- /* p{
- clear: both;
- } */
- /* ::after 伪元素 */
- /* 在当前元素中最后面添加一个伪元素(假的标签) */
- .box::after{
- /* content 伪元素的内容 必须要有 伪元素默认为行元素*/
- content: "";
- /* display 块级元素 */
- display: block;
- /* clear 清除浮动. 必须作用于块级元素上 */
- clear: both;
- }
- </style>
- </head>
- <body>
- <div class="box">
- <div class="item">1</div>
- <div class="item">2</div>
- <div class="item">3</div>
- <!-- <p></p> -->
- </div>
- <div class="box2"></div>
- </body>
- </html>
|