HTML:软式炒作(& shy;)没有破折号? [英] HTML: Soft hypen (­) without dash?

查看:146
本文介绍了HTML:软式炒作(& shy;)没有破折号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小小的布局问题:在客户网站上,我们在一个小盒子里显示人们的联系信息。该框的宽度受到限制。碰巧,有些名字很长的人(毕竟这是在德国......),而电子邮件地址是给定姓名和姓氏的拼接。结果是:使用特定的名称,电子邮件地址会溢出约盒的限制。



插入& shy; @ 之前的$ c>会产生正确的换行符,但看起来像这样:

  john.doe- 
@ example.com

有可能压制那个短跑?我不想使用< br /> ,因为对于90%的名称,可用宽度已经足够了。

$ b $虽然我不确定跨浏览器(可能还算不错),但您始终可以使用精简空格字符(& thinsp; 或零宽度空间(&#8203; )。 ++

  john.doe& thinsp; @ example.com 

++ 我不会建议使用零宽度空间,因为显然某些浏览器无法正确显示它(< )



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 &shy; before the @results in the correct line break, but looks like this:

john.doe-
@example.com

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 (&thinsp;) or the zero-width space (&#8203;).++

john.doe&thinsp;@example.com

++ I would not suggest using the zero-width space, as apparently some browsers will not render it correctly (source).

这篇关于HTML:软式炒作(&amp; shy;)没有破折号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆