打破连字符?

编程入门 行业动态 更新时间:2024-10-13 00:34:19
本文介绍了打破连字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如果一个单词中有一个连字符,IE将允许在 连字符处换行,但Firefox / Mozilla不会。显然Firefox的行为是符合标准的b $ b,但它不是我想要的。有没有办法用 来表示HTML中的连字符,以后该行可以被破坏? 我已经阅读了一些关于软连字符和不间断的连字符,但 这些似乎与我正在寻找的相反。我想要一个正常的 连字符,它总是出现,我希望在Firefox和IE之后它可以破坏它。 有谁知道这是否可行?

If a word has a hyphen in it, IE will permit a line break at the hyphen, but Firefox/Mozilla won''t. Apparently the Firefox behavior is standards-compliant, but it is not what I want. Is there a way to denote a hyphen in HTML, that the line can be broken after? I''ve read some stuff about soft hyphens and non-breaking hyphens, but those seem like the opposite of what I''m looking for. I want a normal hyphen, that always appears, and I want the line to be breakable after it in Firefox as well as IE. Does anyone know if this is possible?

推荐答案

st ********* @ hotmail 写道: st*********@hotmail wrote: 如果一个单词中有一个连字符它,IE将允许在连字符处换行,但Firefox / Mozilla不会。显然,Firefox的行为符合标准, IE行为也是如此。 问题上的规范模糊不清。从技术上讲,HTML 4.01规范说普通连字符 应该由用户代理解释为另一个字符, www.w3/TR/REC-html40/stru .. .t.html#h-9.3.3 但我不认为这是为了禁止在连字符后断开,因为 被建议在HTML 2.0和Unicode标准定义。 有没有办法用表示HTML中的连字符,该行可以在之后被破坏? If a word has a hyphen in it, IE will permit a line break at the hyphen, but Firefox/Mozilla won''t. Apparently the Firefox behavior is standards-compliant, So is the IE behavior. The specifications are obscurely silent on the matter. Technically, HTML 4.01 specification says that "the plain hyphen should be interpreted by a user agent as just another character", www.w3/TR/REC-html40/stru...t.html#h-9.3.3 but I don''t think this is meant to disallow breaking after a hyphen as was suggested in HTML 2.0 and as the Unicode standard defines. Is there a way to denote a hyphen in HTML, that the line can be broken after?

使用< wbr>在连字符之后是实用的方法,例如如 非< wbr>打破 答案很长 www.cs.tut.fi/~jkorpela/html/nobr.html#suggest

Using <wbr> after a hyphen is the practical way, e.g. as in non-<wbr>breaking The long answer is at www.cs.tut.fi/~jkorpela/html/nobr.html#suggest

" Jukka K. Korpela"写道: "Jukka K. Korpela" wrote: st ********* @ hotmail。 com 写道: st*********@hotmail wrote: 如果一个单词中有一个连字符,IE将允许在连字符处换行,但Firefox / Mozilla不会。显然Firefox的行为符合标准, If a word has a hyphen in it, IE will permit a line break at the hyphen, but Firefox/Mozilla won''t. Apparently the Firefox behavior is standards-compliant,

IE的行为也是如此。 事项上的规范模糊不清。从技术上讲,HTML 4.01规范说普通连字符应该由用户代理解释为另一个字符, www.w3/TR/REC-html40/stru...t.html #h-9.3.3 但我不认为这是为了禁止在HTML 2.0中建议使用连字符后断开,并且正如Unicode标准所定义的那样。

So is the IE behavior. The specifications are obscurely silent on the matter. Technically, HTML 4.01 specification says that "the plain hyphen should be interpreted by a user agent as just another character", www.w3/TR/REC-html40/stru...t.html#h-9.3.3 but I don''t think this is meant to disallow breaking after a hyphen as was suggested in HTML 2.0 and as the Unicode standard defines.

>有没有办法在HTML中表示连字符,以后该行可以被破坏? > Is there a way to denote a hyphen in HTML, that the line can be broken after?

使用< wbr>在连字符之后是实用的方法,例如如 non< wbr> break 答案很长 www.cs.tut.fi/~jkorpela/html/nobr.html#suggest

Using <wbr> after a hyphen is the practical way, e.g. as in non-<wbr>breaking The long answer is at www.cs.tut.fi/~jkorpela/html/nobr.html#suggest

< wbr>是非标准的,并且不被所有浏览器识别。它确实在HTML 4.01规范中不存在。 为CSS3指出了破解和包装样式。但是, 规范仍在不断变化,并且明年某个时候接受 受影响文本模块的草案评论。我不知道有什么浏览器能够实现 CSS3文本模块的建议草案。 - David E. Ross < URL:http://www.rossde/> 我使用Mozilla作为我的Web浏览器,因为我想要一个符合Web标准的浏览器 。请参阅< URL:http://www.mozilla/>。

<wbr> is non-standard and not recognized by all browsers. It does not exist in the HTML 4.01 specification. Breaking and wrapping styles are indicated for CSS3. However, the specification is still in flux with comments on the draft for the affected text module being accepted until some time next year. I don''t know of any browsers that implement the proposed draft of the CSS3 text module. -- David E. Ross <URL:www.rossde/> I use Mozilla as my Web browser because I want a browser that complies with Web standards. See <URL:www.mozilla/>.

David Ross< no **** @ nowhere.not>写道: David Ross <no****@nowhere.not> writes: " Jukka K. Korpela"写道: 让我们在这里加一些重点 "Jukka K. Korpela" wrote: Let''s add some emphasis here 使用< wbr>在连字符之后是实用的方法,例如如 ^^^^^^^^^ non< wbr> break 答案很长 www.cs.tut.fi/~jkorpela/html/nobr.html#suggest Using <wbr> after a hyphen is the practical way, e.g. as in ^^^^^^^^^ non-<wbr>breaking The long answer is at www.cs.tut.fi/~jkorpela/html/nobr.html#suggest

< wbr>是非标准的

<wbr> is non-standard

什么 - *标准*? IIRC,最近才使用了width和height属性因为实际原因,这里建议使用 IMG元素类型。他们也是* b $ b非*标准*并且没有人出现抱怨,据我所知 重新收集。 并且不被所有浏览器。 我敢说,大多数浏览器都会在 首先关注这些细节。 OTOH,很多推荐的甚至是b $ b标准化的元素类型要么不被识别,要么 - 更糟糕,实际上 - 没有正确处理(例如NOSCRIPT)。 br /> HTML 4.01规范中不存在。

What-*standard*? IIRC, just recently the use of the width and height attribute for the IMG element type were suggested here for practical reasons. They are non-*standard* as well and nobody appeared to complain, as far as I can recollect. and not recognized by all browsers. It''s recognized by most browsers that care about such details in the first place, I dare saying. OTOH, lots of recommended or even standardized element-types are either not recognized as well or -- worse, actually -- not processed properly (e.g. NOSCRIPT). It does not exist in the HTML 4.01 specification.

如果有帮助,HTML 4.01推荐本身就是非标准的。

If it helps, the HTML 4.01 recommendation itself is non-standard.

更多推荐

打破连字符?

本文发布于:2023-11-29 13:41:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1646541.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!