Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display HTML "title" attribute in multiple lines in Firefox? [duplicate]

Tags:

html

title

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 ?

like image 406
Misha Moroshko Avatar asked Mar 04 '11 11:03

Misha Moroshko


People also ask

How do you insert a line break in title attribute?

You can use &#013; or &#010; .

How do you style title attribute?

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.

How do you style a title in HTML?

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!

Is title a global attribute?

The title attribute is part of the Global Attributes, and can be used on any HTML element.


2 Answers

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

<div title="Line 1&#10;Line 2">Secret</div> 
like image 124
anothershrubery Avatar answered Oct 10 '22 07:10

anothershrubery


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.

like image 30
nollfem Avatar answered Oct 10 '22 07:10

nollfem