开发者

How to I add a line feed to a title style tooltip in firefox?

开发者 https://www.devze.com 2023-02-02 03:08 出处:网络
Firefox does not seem to support line feeds in the title attribute.I have tried \\r, \\r\\n, \\n, 
, 
, and still found nothing that works.

Firefox does not seem to support line feeds in the title attribute. I have tried \r, \r\n, \n, 
, 
, and still found nothing that works.

Does anyone have a h开发者_JAVA百科ack to get around this?


There is nothing is the spec about how exactly browsers have to display the value in title attributes.

Is simply says:

Values of the title attribute may be rendered by user agents in a variety of ways. For instance, visual browsers frequently display the title as a "tool tip"

(Emphasis mine)

So, not only is there nothing about line breaks, but the actual behavior of "tool tip" is not mandatory.


Firefox doesn't support this. On other browsers like Chrome, just use return.

<a href="..." title="My

long

title">My link</a>

Alternatively you could use the JQuery Tooltip Plugin. It works in all browsers and let's you use html in your tooltips.

0

精彩评论

暂无评论...
验证码 换一张
取 消