嵌套的<跨度>导致新行

发布于 2024-09-06 01:24:19 字数 544 浏览 2 评论 0原文

我有包含 * 的 jsp 页面,

我使用 jsp include 将其包含在另一个 jsp 页面上,如下所示

出生日期:<%@include file="/jsps/includes/requiredFieldsLabel.jsp"%> 这很好用。没有新线。

但是,当我将其嵌套在另一个范围内时,如下所示:

Date of Birth:<span id="includeMandatoryDOB"><%@include file="/jsps/includes/requiredFieldsLabel.jsp"%></span>

它会创建一个新行。我尝试过强制显示:内联,但它什么也没做(正如我预期的那样)。没有其他样式元素。

这是在 IE6 上,有什么想法吗?在 chrome 上效果很好,没试过 firefox。但 IE6 是必需的。

I have jsp page that contains<span class="requiredFieldsMessageAsterix">*</span>

I use a jsp include to include this on another jsp page as here


Date of Birth:<%@include file="/jsps/includes/requiredFieldsLabel.jsp"%>

This works fine. No new line.

However when I nest this include within another span as here :

Date of Birth:<span id="includeMandatoryDOB"><%@include file="/jsps/includes/requiredFieldsLabel.jsp"%></span>

It creates a new line. I have tried forcing display:inline, but it did nothing(as I expected). There is no other styling the elements.

This is on IE6, any ideas ? It works fine on chrome, not tried firefox. But it is required for IE6.

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

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

发布评论

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

评论(1

痴者 2024-09-13 01:24:19
  • 您在文档顶部指定了什么 DOCTYPE?尝试

http://www.w3.org/TR/xhtml11/DTD/xhtml11 .dtd">

  • 父容器是否足够宽,可以在不换行的情况下显示内容? (由于 doctype,IE 可能处于怪异模式,从而错误地计算其宽度并导致换行)

您可能需要下载 IE6/IE7 的 IE 开发工具栏,以通过单击选择元素并确定哪些元素的大小由使用线框视图:
http://www.microsoft.com/downloads/details.aspx microsoft.com/downloads/details.aspx?familyid=E59C3964-672D-4511-BB3E-2D5E1DB91038&displaylang=en

注意:IE8+ 具有内置开发工具栏,按 F12 即可使用

  • What DOCTYPE are you specifying at the top of the document? Try

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

  • Is the parent container wide enough to display the content without wrapping? (because of doctype, IE could be in quirks mode and thus calculating what its width should be incorrectly and causing wrapping)

You may want to download IE developer toolbar for IE6/IE7 to use select element by click and determine which elements are being sized by using the wireframe view:
http://www.microsoft.com/downloads/details.aspx?familyid=E59C3964-672D-4511-BB3E-2D5E1DB91038&displaylang=en

Note: IE8+ have the dev toolbar builtin and usable by pressing F12

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文