HTML:连字符(& shy;)不带破折号? [英] HTML: Soft hyphen (­) without dash?
问题描述
我有一个布局问题:在客户网站上,我们在一个小盒子中显示人员的联系信息.该盒子的宽度受到限制.碰巧的是,有些人的名字很长(毕竟这是在德国……),而电子邮件地址是给定名字和姓氏的串联.结果:使用某些名称,电子邮件地址溢出了about框所给出的约束.
I have a little layout problem: on a clients website, we show contact information of people in a little box. The width of that box is constrained. As it happens, there are people with very long names (this is in Germany, after all...), and the email address is a concatenation of the given name and family name. The result: with certain names, the email address overflows the constraints given by the about box.
在@
之前插入­
会导致正确的换行符,但是看起来像这样:
Inserting a ­
before the @
results in the correct line break, but looks like this:
john.doe-
@example.com
是否可以抑制破折号?我不想使用<br />
,因为对于90%的名称,可用宽度都绰绰有余.
Is it possible to suppress that dash? I don't want to use <br />
, because for 90% of the names, the available width is more than enough.
推荐答案
尽管我不确定跨浏览器的效果如何(可能很好),但是您始终可以使用稀疏字符( 
)或零宽度空格( ++ ​
).
Though I'm not sure how this does cross-browser (probably pretty well), you could always use the thin space character ( 
) or the zero-width space (++​
).
john.doe @example.com
++ 我不建议使用零宽度空间,因为显然某些浏览器无法正确呈现它(
++ I would not suggest using the zero-width space, as apparently some browsers will not render it correctly (source).
这篇关于HTML:连字符(& shy;)不带破折号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!