首页 > 技术文章 > css实现左边高度自适应右边高度

mhtss 2019-07-30 22:22 原文

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>css</title>
<style>
.container{border: 5px solid #00BCD4;overflow: hidden}
.left-content{
float: left;
width: 300px;
height: auto;
background-color: red;
color: #fff;
padding-bottom: 9999px;
margin-bottom: -9999px;
}
.right-content{
margin-left: 300px;
height: auto;
padding-bottom: 9999px;
margin-bottom: -9999px;
color: #fff;
background-color: blue;
}
</style>
</head>
<body>
<div class="container">
<div class="left-content">
手可摘星辰
</div>

<div class="right-content">
危楼高百尺,手可摘星辰,不敢高声语,恐惊天上天
危楼高百尺,手可摘星辰,不敢高声语,恐惊天上天
危楼高百尺,手可摘星辰,不敢高声语,恐惊天上天
危楼高百尺,手可摘星辰,不敢高声语,恐惊天上天
危楼高百尺,手可摘星辰,不敢高声语,恐惊天上天

危楼高百尺,手可摘星辰,不敢高声语,恐惊天上天
危楼高百尺,手可摘星辰,不敢高声语,恐惊天上天

危楼高百尺,手可摘星辰,不敢高声语,恐惊天上天
危楼高百尺,手可摘星辰,不敢高声语,恐惊天上天
危楼高百尺,手可摘星辰,不敢高声语,恐惊天上天
危楼高百尺,手可摘星辰,不敢高声语,恐惊天上天
危楼高百尺,手可摘星辰,不敢高声语,恐惊天上天
危楼高百尺,手可摘星辰,不敢高声语,恐惊天上天

</div>
</div>
</body>
</html>

推荐阅读