1. 主页
  2. 文档
  3. CSS
  4. CSS3浮动定位与背景样式
  5. 浮动

浮动

<!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 {
            width: 600px;
            height: 200px;
            border: 1px solid #000;
        }
        .box .c1 {
            width: 200px;
            height: 200px;
            background-color: orange;
            float: left;
        }
        .box .c2 {
            width: 200px;
            height: 200px;
            background-color: green;
            float: left;
        }
        .box .c3 {
            width: 200px;
            height: 200px;
            background-color: blue;
            float: left;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="c1"></div>
        <div class="c2"></div>
        <div class="c3"></div>
    </div>
</body>
</html>
这篇文章对您有用吗?

我们要如何帮助您?