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: right;
        }

        .box .c2 {
            width: 200px;
            height: 200px;
            background-color: green;
            float: right;
        }

        .box .c3 {
            width: 200px;
            height: 200px;
            background-color: blue;
            float: right;
        }
    </style>
</head>

<body>
    <div class="box">
        <div class="c1">1</div>
        <div class="c2">2</div>
        <div class="c3">3</div>
    </div>
</body>

</html>
这篇文章对您有用吗?

我们要如何帮助您?