Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding a line break in the title attribute [duplicate]

Tags:

html

i would like to find out how to add a break in the title attribute, i would like to have breaks in the title attribute to differentiate the names. how can i add a break in the title attribute?

i have something like this

<p title="this is a description of the some text <br> and further description">Some Text</p>

what comes out is:image showing <br> in stead of braking.

like image 376
Inventor Avatar asked Nov 14 '13 15:11

Inventor


People also ask

How do you insert a line break in title attribute?

If the title attribute's value contains "LF" (U+000A) characters, the content is split into multiple lines. Each "LF" (U+000A) character represents a line break.

How do you add a line break in data title in HTML?

The <br> tag inserts a single line break. The <br> tag is useful for writing addresses or poems. The <br> tag is an empty tag which means that it has no end tag.

Which attribute is used to break a line?

The <BR> element is used to force a line break.

How do you add line breaks?

Press ALT+ENTER to insert the line break.


1 Answers

If you add a new line where you want line breaks, it works on SOME browsers, but not all.

Example:

div { background-color: #c3c3c3; display: block; width: 100px; height: 100px; }
<div title="This is a text
    Second line
    Third line!">Contents</div>

JSFiddle:
http://jsfiddle.net/g5CGh/

like image 187
NoLifeKing Avatar answered Oct 08 '22 10:10

NoLifeKing