想象一下结构:
<div class="container">
<div class="first">Variable, but Desired Width</div>
<div class="second">Text that may be long. But it should not exceed the width of the element above.</div>
</div>
我正在寻找纯CSS 解决方案(如果可能的话)以下内容:
.first
是内联块,其宽度可能因内容而异。
我希望.second
占据.first
的全宽,不超过。
一张图片胜过千言万语: