Característica flotante (difícil y difícil) - fuera de etiqueta

Código:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
          
          .box1{
                float: left;
                width:  200px;
                height: 200px;
                background-color: pink;
          }

          .box2{
                width:  300px;
                height: 300px;
                background-color: rgb(0, 153, 255)
          }
          
    </style>
</head>

<body>
        <div class="box1">浮动的盒子</div>
        <div class="box2">标准流的盒子</div> 
</body>

</html>

resultado de ejecución

 Además, la caja flotante flotará en el aire y la posición no está reservada.

Si la otra caja no agrega flotador, correrá hasta el fondo

Supongo que te gusta

Origin blog.csdn.net/weixin_42900834/article/details/123907464
Recomendado
Clasificación