css - 在相同高度缩放 float div

我有这个 html:

<div class="exwrap">
    <div class="listpages"> </div>
    <div class="excerpt"> </div>
</div>`

和CSS:

.listpages {
    width: 28%;
    float: left;
    height: 100%;
}

.excerpt {
    width: 70%;
    float: right;
    height: 100%;
}

我希望 .listpages 和 .excerpt 具有相同的高度,但这仅在我具有固定高度的 .exwrap 时有效,但我需要具有动态高度并且较小的高度具有较大的高度。

谢谢。

最佳答案

float 是不可能的,但表格单元格(demo)可以:

.listpages {
    width: 28%;
    display: table-cell;
}

.excerpt {
    width: 70%;
    display: table-cell;
}

关于css - 在相同高度缩放 float div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17470081/

相关文章:

php - 无法使用多语言 codeigniter 摆脱 URL 中的默认 Controller

ruby-on-rails - 如何在 Fabrication 的计数参数中使用 transient

solr - 使用 OR 的嵌套功能范围查询

python - 用于 gtk 应用程序的交互式 python 控制台

Android - 将大量数据传递给在不同进程上运行的服务

ruby-on-rails - Rails - has_secure_password 密码和 PI

python - 在python中使用smtp发送电子邮件不起作用

jdbc - 配置单元 jdbc 连接发出内存不足错误

ruby - 使用 ruby​​_gnuplot 在 Ruby 中制作动画 3d 散点图

objective-c - 当模拟器从 XCode 关闭时,是否有运行的方法?