Possible Duplicate:
How can I use a carriage return in a HTML tooltip ?
I would like to display 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 use 
 or 
 .
You can't style an actual title attribute How the text in the title attribute is displayed is defined by the browser and varies from browser to browser. It's not possible for a webpage to apply any style to the tooltip that the browser displays based on the title attribute.
The <title> tag defines the title of the document. The title must be text-only, and it is shown in the browser's title bar or in the page's tab. The <title> tag is required in HTML documents!
The title attribute is part of the Global Attributes, and can be used on any HTML element.
You can enter
. In other words:
<div title="Line 1 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With