【发布时间】:2013-09-22 19:43:37
【问题描述】:
我有两个内联块(图像然后是内容),我想像这样水平放置:
尽管当容器变小时,图像和内容块不再保持内联。我希望容器不断增加高度来处理内容文本的换行,如下所示:
如果容器达到限制,元素将移动并居中,但始终尽量不要在两侧创建尽可能少的空白,如下所示:
我有一些几乎可以工作的 HTML:Example
<div style="margin:20px; height:auto; box-shadow: 2px 2px 1px #999999; border-style:solid; border-width:1px; border-color:#dddddd; padding:4px; background-color:white; " >
<div style="width:100%;" >
<div style="display:inline-block; padding-top:4px; height:100px; width:100px;">
<img src='http://placekitten.com/100/100'>
</div>
<div style="display:inline-block; vertical-align:top; padding-top:4px; min-width:70%; max-width:70%;">
<h2 style=" font-size:12px;">About</h2>
<p style="font-size:10px;">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry. </p>
</div>
</div>
</div>
【问题讨论】:
-
您的小提琴表明您将 70% 的
max-width分配给内部 div。 -
删除最大宽度只会让问题变得更糟:)
-
我想我无法理解你在做什么
-
只是为了创建图像中显示的效果
标签: jquery html css responsive-design