浮动的作用
早期:图文环绕
现在:让垂直布局的盒子变成水平布局
浮动的代码
属性名:float
左浮动:float: left;
右浮动:float: right;
代码如下:
<style>
.left {
width: 100px;
height: 100px;
background-color: red;
float: left;
}
.right {
width: 100px;
height: 100px;
background-color: skyblue;
float: right;
}
</style>