使用 css 包裹文本

发布于 2024-07-29 17:48:56 字数 392 浏览 2 评论 0原文

我有以下 html:

<label class="description">Label Text</label><input type="password" />

并且 css 样式为:

fieldset span.formrow label.description {
    width: 150px;
    display: -moz-inline-box;
    display: inline-block;
}

我的问题是,在 Firefox 2 中,如果文本超过 150px 限制,则该行不会中断。 相反,文本显示在输入文本字段后面。

这种行为有可能改变吗?

I have the following html:

<label class="description">Label Text</label><input type="password" />

And the css styles are:

fieldset span.formrow label.description {
    width: 150px;
    display: -moz-inline-box;
    display: inline-block;
}

My problem is that in Firefox 2 if the text goes over the 150px limit, then the line does not break. Instead the text is displayed behind the input text field.

Any chance that the behavior can be altered?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

说谎友 2024-08-05 17:48:56
fieldset span.formrow label.description { 
  width: 150px; 
  float:left;
  clear:left; 
}

尝试这个!

安德鲁

fieldset span.formrow label.description { 
  width: 150px; 
  float:left;
  clear:left; 
}

Try this!

Andrew

故笙诉离歌 2024-08-05 17:48:56

尝试:

fieldset span.formrow label.description { width: 150px; display: block; float: left; } 

Try:

fieldset span.formrow label.description { width: 150px; display: block; float: left; } 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文