包装标题属性 [英] Wrapping title attribute

查看:52
本文介绍了包装标题属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Firefox不使用 a title 属性包装文字:

Firefox does not wrap words in a title attribute:

<a title="longword"></a>

在这种情况下,是否可以使用自动换行功能?我尝试过:

Is there a way to do word-wrapping in that case? I tried with:

<a title="longword" style="word-wrap:break-word;"></a>

但它不起作用。

而是由Chrome自动包装。

Chrome, instead, automatically wraps.

推荐答案

不,您不能使Firefox偏离其呈现方式 title 属性值; cf.到如何在HTML工具提示?

No, you cannot make Firefox deviate from its way of rendering title attribute values; cf. to How can I use a carriage return in a HTML tooltip?

使用 title 属性创建的工具提示的可用性存在疑问(小字体用户无法轻易增加;几秒钟后就会消失;等等),因此它们(最多)适用于简短的咨询标题(主要是链接),而无需包装。

The tooltips created by using title attributes are of questionable usability (tiny font that cannot be easily increased by the user; disapperance after some seconds; etc.), so they are suitable (at most) for short advisory titles (mainly for links), which not cause a need for wrapping.

有关更长的工具提示,请考虑使用CSS技术。或者只是将提示放入文本中。

For longer tooltips, consider using CSS techniques. Or just put the tip into the text proper.

这篇关于包装标题属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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