gpt4 book ai didi

css - 如何为旧 IE 制作没有 flexbox 的灵活 block

转载 作者:太空宇宙 更新时间:2023-11-04 11:50:42 25 4
gpt4 key购买 nike

有一个关于简单表单的问题,有输入和按钮,Цe 需要一个 block 填充框内 100% 的可用空间,其中可能有其他元素,没有它们的包装。

enter image description here

这很容易用 flexbox 完成,但它不支持 IE 8-9。请帮我。谢谢,尤金。

最佳答案

使用 CSS 表格布局应该可以根据内容提供灵 active :http://jsfiddle.net/37rxjskx/

.row {
display: table;
/* table-layout: fixed; */
/* width: 100%; */
}

.col,
button {
display: table-cell;
padding: 8px 12px;
outline: 1px dashed red;
}
<div class="row">
<div class="col">input auto 100% of the free width space</div>
<button type="submit">button<br> auto of the<br> inner content</button>
</div>

table-layout: fixed 做相反的事情:让浏览器应用您的宽度限制并忽略内容的相对数量。

我之前对同一主题所做的各种回答:equal width , same height , fill remaining space

关于css - 如何为旧 IE 制作没有 flexbox 的灵活 block ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30662766/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com