div实现两列等高

Posted 川衡

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了div实现两列等高相关的知识,希望对你有一定的参考价值。

参考代码如下

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>两列等高</title>
        <style type="text/css">
            html,bodywidth: 100%;height: 100%;
            *margin: 0;padding: 0;
            .container

            
            .left,.right
                width: 200px;
                background-color: #F2F0F1;
            
            .left
                min-height: 50px;
                position: relative;
            
            .right
                background-color: red;
                position: absolute;
                right: -200px;
                top: 0;
                height: 100%;
            
        </style>
    </head>
    <body>
        <div id="container">
            <div class="left">
                tttttttt<br/>
                pppppppp,<br/>
                tttttttt<br/>
                pppppppp,<br/>
                tttttttt<br/>
                pppppppp,<br/>
                tttttttt<br/>
                pppppppp,<br/>
                tttttttt<br/>
                pppppppp,<br/>
                tttttttt<br/>
                pppppppp,<br/>
                tttttttt<br/>
                pppppppp,<br/>
                <div class="right"></div>
            </div>
        </div>
    </body>
</html>

以上是关于div实现两列等高的主要内容,如果未能解决你的问题,请参考以下文章