【发布时间】:2014-09-05 14:00:43
【问题描述】:
我可以让父 div 的宽度自动等于其子 div 的最大宽度吗? IE。我希望父母与最宽的孩子一样宽,而不是更宽。我可以接受纯 css 和 javascript 解决方案。
特别是I have a parent div with two floating divs inside。我希望在右 div 低于(如果窗口变得太窄)时调整父 div 的大小,以使父 div 的背景正确显示。
谢谢!
<div class="container">
<div class="logo-div">
<img class="logo" src="http://bit.ly/1qCKrtJ" />
</div>
<div class="text-div">
<h4 style="display: inline;">Because Sometimes It Takes a Village</h4><br />
What about robots the size of tea cups that scoot around on tiny wheels, snapping pictures with miniature cameras and keeping track of where they are in relation to dozens of others?
</div>
</div>
【问题讨论】:
标签: javascript html css layout web