HTML title Global Attribute

Description

The title global attribute is used to specify extra information about an element. This information is most often shown as a tooltip text when the mouse moves over the element. The title attribute can be used on any HTML element, but it is most commonly used on images, links, and form controls.

The title attribute is a global attribute, which means that it can be used on any HTML element. However, it is important to note that the title attribute may not have any effect on some elements. For example, the title attribute will not have any effect on the head element.

Here are some examples of how to use the title attribute:

<img src="my-image.jpg" title="This is my image." />
<a href="https://www.google.com" title="This is a link to Google.">Google</a>
<input type="text" name="username" title="Enter your username here." />

In these examples, the title attribute will be used to display a tooltip text when the user hovers over the image, link, or form control. The tooltip text can be used to provide additional information about the element, such as a description of the image, the destination of the link, or instructions on how to use the form control.

The title attribute is a useful way to provide additional information to users about your web pages. It can be used to improve the usability and accessibility of your pages.

Syntax

<element title="text">

Values

  • textA textual hint about the contents of the element (appears when you hover over the element).

Example

<p>The three primary web development technologies are
<abbr title="Hypertext Markup Language">HTML</abbr>,
<abbr title="Cascading Stylesheets">CSS</abbr>, and
JavaScript.</p>

Browser Support

The following table will show you the current browser support for the HTML title Global Attribute.

Desktop
Edge Chrome Firefox Opera Safari
YesYesYesYesYes
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview
YesYesYesYesYesYes

Last updated by CSSPortal on: 14th October 2023