开发者

How can I display the HTML "title" attribute in multiple lines in Firefox? [duplicate]

开发者 https://www.devze.com 2023-02-14 15:47 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: How can I use a carriage return in a HTML tooltip?
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

How can I use a carriage return in a HTML tooltip?

I would like to displ开发者_开发知识库ay the "title" attribute tooltip in several lines, so it looks like this:

Line 1
Line 2

I tried to do:

<div title="Line 1\nLine 2">Secret</div>

but it didn't work.

Is that possible?


You can enter &#10;. In other words:

<div title="Line 1&#10;Line 2">Secret</div>


As stated in How can I use a carriage return in a HTML tooltip? you can just do it like this:

<div title="Line 1  
Line 2">Secret</div>

Though it is said that it doesn't work with Firefox.


Either add new lines within the HTML content itself

<div title="Line 1
Line 2">Secret</div>

Or make your own tooltip using JavaScript and CSS.

0

精彩评论

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

关注公众号