小编use*_*456的帖子

将div设置为其兄弟宽度

我正在寻找以下的CSS解决方案: -

<div style="display:inline;">
     <div>The content of this div is dynamically created but will always be wider than
              the below div. 
     </div>
     <div> Need this div to have the same width as the above div.
     </div>
</div>
Run Code Online (Sandbox Code Playgroud)

包装器div具有内联显示并按预期工作,两个子div都具有动态生成的内容.我需要底部采取前一个兄弟的宽度.

非常感谢您提前提出的任何建议.

html css html5 css3

26
推荐指数
4
解决办法
2万
查看次数

标签 统计

css ×1

css3 ×1

html ×1

html5 ×1