div实现两列等高

来源:互联网 发布:zookeeper mysql 集群 编辑:程序博客网 时间:2024/05/21 17:27

参考代码如下

<!DOCTYPE html><html>    <head>        <meta charset="utf-8" />        <title>两列等高</title>        <style type="text/css">            html,body{width: 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>
0 0
原创粉丝点击