多列等高佈局

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        .box { 
            width: 600px;
            border: 2px solid #00f;
            overflow: hidden;
        }
        .clear{ clear: both; }
        .left, .right { 
            float: left; 
            width: 300px;
            padding-bottom: 2000px;
            margin-bottom: -2000px;
        }
        .left {
            background-color: #b0b0b0;
        }
        .right {
            background-color: #cc0;
        }
    </style>
</head>
<body>
<p>padding補償法</p>
    <div class="box">
        <div class="left">我在左邊</div>
        <div class="right">我在右邊 <br>
            我就是想換幾行Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iure sit fuga provident earum reprehenderit vitae eos mollitia excepturi necessitatibus deserunt pariatur repellendus omnis ipsa, ab amet, dolor harum consequatur. Hic.
        </div>
        <div class="clear"></div>
    </div>
</body>
</html>
相關文章
相關標籤/搜索