相关疑难解决方法(0)

HTML中的软连字符(<wbr> vs.&shy;)

如何解决网页上的软连字符问题?在文本中可能有一些长词,您可能想要用连字符换行.但是你不希望连字符显示整个单词是否在同一行.

根据这个页面 <wbr>上的评论是由Netscape发明的非标准"标签汤".它似乎&shy; 也存在标准合规性方面的问题.似乎没有办法为所有浏览器提供有效的解决方案.

处理软连字符的方法是什么?为什么选择它?有优选的解决方案还是最佳实践?


请参阅相关的SO讨论在这里.

html text soft-hyphen wbr

148
推荐指数
6
解决办法
12万
查看次数

什么是相反的?

一个&nbsp;字符是不允许换行的空间.

<p>lorem ipsum here&nbsp;are&nbsp;some&nbsp;words and so on</p>

| lorem ipsum                |
| here are some words and so |
| on                         |
Run Code Online (Sandbox Code Playgroud)

与此相反的是什么?也就是说,一个字符不是作为空格呈现的,但可以用于换行.

<p>foo supercalifragilisticexpialidocious bar</p>
<!--   put char here ^   and here ^ -->

|foo supercalifragi |
|listicexpiali      |
|docious bar        |

or with wider size:

|foo supercalifragilisticexpiali   |
|docious bar                       |
Run Code Online (Sandbox Code Playgroud)

我知道的软连字符,但我的目的,我专门做希望在休息加连字符.

html character line-breaks hyphenation

85
推荐指数
3
解决办法
1万
查看次数

标签 统计

html ×2

character ×1

hyphenation ×1

line-breaks ×1

soft-hyphen ×1

text ×1

wbr ×1