IE6 HTML 控件包装
有什么方法可以防止 IE6 中控件之间的换行吗?例如,我有一个标签和一个选择框。选择框宽度是动态的(取决于内容)。我希望标签始终位于选择框的左侧。现在我遇到的问题是选择框落在标签下方。我尝试过使用
Is there any way to prevent wrapping across controls in IE6? For example, I have a label and a single select box. The select box width is dynamic (depending on the content). I want the label to always be to the left of the select box. Right now the problem I am having is the select box drops below the label. I have tried using the <nobr>
tag as well as CSS word-wrap rules, but because this isn't text the wrapping rules do not apply. The only way I have found for sure to make it work is to place them in a two-column table, but I do not like this solution. Is there any other way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果标签和输入都有内联显示(“display: inline;”)并且输入换行,则父容器可能太窄。话虽如此,典型的水平标签表单布局并不依赖于这种内联显示,它们采用了一种利用块级浮动元素的更受控制的方法。例如,给定以下 HTML:
您可以使用以下 CSS 设置标签的位置:
有一个 具体细节有很多变化,但上面传达了基本概念。
If both the label and the input have an inline display ("display: inline;") and the input is breaking to a new line, then chances are the parent container is too narrow. With that said, typical horizontal-label form layouts don't rely on this inline display, they take a more controlled approach utilizing block-level, floated elements. For example, given the following HTML:
You could set the position of the label with the following CSS:
There's a ton of variations on the specifics, but the above conveys the basic concept.