【发布时间】:2014-03-27 06:31:36
【问题描述】:
我想组织我的文章,使标题适合一个框,几乎与缩进一样 在发布者下方.. 如果我将最大宽度设置为 300 像素,它会起作用;但我不希望定义宽度 - 它应该适合剩余的宽度。
-----------------BODY------------------
| |
||-------------CONTAINER-------------||
||-PUPLISHER-----TITLE-fits remaining||
|||____________||width, text wrapped|||
|| |___________________|||
||___________________________________||
|_____________________________________|
如果我将最大宽度设置为 300 像素,它会起作用;但我不希望定义宽度 - 它应该适合剩余的宽度。
<div>
<span style="display: inline-block;">
content: one line no wrap, Stretches to fit text length;
</span>
<div style=" display: inline-block; max-width: 300px; " >
content: block box, Stretches to fit remaining width, longer text is wrapped.
</div>
</div>
【问题讨论】:
标签: html css shrinkwrap