The title attribute on a <pre> tag adds a tooltip with title text to the pre element.
Hovering the mouse over the pre area will display the tooltip.
A title attribute on a <pre> tag.
Hover over the <pre> element to see the tooltip.
SELECT FirstName, LastName FROM Customer ORDER BY LastName
<pre title="SQL query retrieving customers."
style="background:whitesmoke;padding:5px;">
SELECT FirstName, LastName
FROM Customer ORDER BY LastName
</pre>
The title attributes attaches additional information to the <pre> element.
The title value displays as a tooltip.
The tooltip displays when the pre element is hovered.
<pre title="value">
Value | Description |
---|---|
value | A string value. A title can span multiple lines by including newline or carriage-return characters: or 
. |
Here is when title support started for each browser:
Chrome
|
1.0 | Sep 2008 |
Firefox
|
1.0 | Sep 2002 |
IE/Edge
|
1.0 | Aug 1995 |
Opera
|
1.0 | Jan 2006 |
Safari
|
1.0 | Jan 2003 |
Back to <pre>