作者热门文章
- objective-c - iOS 5 : Can you override UIAppearance customisations in specific classes?
- iphone - 如何将 CGFontRef 转换为 UIFont?
- ios - 以编程方式关闭标记的信息窗口 google maps iOS
- ios - Xcode 5 - 尝试验证存档时出现 "No application records were found"
当重新调整浏览器大小时视口(viewport)变小时,如何使相邻 float 的 DIV 不换行?
div {
float: left;
}
例如,当浏览器完全最大化时,div
的排列如下:
|div| |div| |div| |div| |div| |div| |div| |div|
但是当浏览器的尺寸变小时,会发生这种情况:
|div| |div| |div| |div| |div|
|div| |div| |div|
当浏览器变小时,如何让 div
不换行?
最佳答案
将它们包裹在另一个指定了宽度(或最小宽度)的 div 中。
<div class="parentContainer">
<div class="floater"></div>
<div class="floater"></div>
<div class="floater"></div>
</div>
.parentContainer {
/* The width of the parent needs to be equal to the total width of the children.
Be sure to include margins/padding/borders in the total. */
width: 600px;
overflow: auto;
}
在包含的 div 上指定 overflow: auto 也有帮助,以允许其高度与子 float 匹配。
关于html - 重新调整浏览器大小时,如何防止 float 的 div 元素换行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2275129/
在 Vaadin 7.0,显示时JavaBean Table 中的数据与 BeanContainer ,用新数据刷新表的正确方法是什么? 最佳答案 该表通过监听器监视表项的属性。如果您通过表的 Ite
首先,我使用的是带有 Axis2 1.6.2 的 eclipse,我正在 tomcat 6 上部署我创建的 Web 服务。Web 服务是在 eclipse 中通过自上而下的方法创建的。 我被要求使对我
我已将 Rails 3.1.1 应用程序升级到 Rails 3.1.3,现在,对于每个请求,它仅响应错误数量的参数(3 for 1)。不幸的是,它没有说明错误在哪里,并且应用程序跟踪为空。我认为存在一
我是一名优秀的程序员,十分优秀!