The title attribute specifies extra information about an element such as a description or definition that would not be otherwise shown.
The information is usually shown as a tooltip text when the mouse hovers over the element.
Use of the title attribute in an HTML document:
Attribute |
![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|---|
title | Yes | Yes | Yes | Yes | Yes |
In HTML5, the title attribute can be used on any HTML element (it will validate on any HTML element. However, it is not necessarily useful).
In HTML 4.01, the title attribute cannot be used with: <base>, <head>, <html>, <meta>, <param>, <script>, <style>, and <title>.
Value | Description |
---|---|
text | A tooltip text for an element |
= New in HTML5
Tag | Description |
---|---|
<!--...--> | Defines a comment |
<!DOCTYPE> | Defines the document type |
<a> | Defines a hyperlink |
<abbr> | Defines an abbreviation or an acronym |
<acronym> | Not supported in HTML5. Use <abbr>
instead. Defines an acronym |
<address> | Defines contact information for the author/owner of a document |
<applet> | Not supported in HTML5. Use <embed> or
<object> instead. Defines an embedded applet |
<area> | Defines an area inside an image-map |
![]() |
Defines an article |
![]() |
Defines content aside from the page content |
![]() |
Defines sound content |
<b> | Defines bold text |
<base> | Specifies the base URL/target for all relative URLs in a document |
<basefont> | Not supported in HTML5. Use CSS
instead. Specifies a default color, size, and font for all text in a document |
![]() |
Isolates a part of text that might be formatted in a different direction from other text outside it |
<bdo> | Overrides the current text direction |
<big> | Not supported in HTML5. Use CSS
instead. Defines big text | '
<blockquote> | Defines a section that is quoted from another source |
<body> | Defines the document's body |
<br> | Defines a single line break |
<button> | Defines a clickable button |
![]() |
Used to draw graphics, on the fly, via scripting (usually JavaScript) |
<caption> | Defines a table caption | '
<center> | Not supported in HTML5. Use CSS
instead. Defines centered text |
<cite> | Defines the title of a work |
<code> | Defines a piece of computer code |
<col> | Specifies column properties for each column within a <colgroup> element |
<colgroup> | Specifies a group of one or more columns in a table for formatting |
![]() |
Specifies a list of pre-defined options for input controls |
<dd> | Defines a description/value of a term in a description list |
<del> | Defines text that has been deleted from a document |
![]() |
Defines additional details that the user can view or hide |
<dfn> | Represents the defining instance of a term |
![]() |
Defines a dialog box or window |
<dir> | Not supported in HTML5. Use <ul>
instead. Defines a directory list |
<div> | Defines a section in a document |
<dl> | Defines a description list |
<dt> | Defines a term/name in a description list |
<em> | Defines emphasized text |
![]() |
Defines a container for an external (non-HTML) application |
<fieldset> | Groups related elements in a form |
![]() |
Defines a caption for a <figure> element |
![]() |
Specifies self-contained content |
<font> | Not supported in HTML5. Use CSS
instead. Defines font, color, and size for text |
![]() |
Defines a footer for a document or section |
<form> | Defines an HTML form for user input |
<frame> | Not supported in HTML5. Defines a window (a frame) in a frameset |
<frameset> | Not supported in HTML5. Defines a set of frames |
<h1> to <h6> | Defines HTML headings |
<head> | Defines information about the document |
![]() |
Defines a header for a document or section |
<hr> | Defines a thematic change in the content |
<html> | Defines the root of an HTML document |
<i> | Defines a part of text in an alternate voice or mood |
<iframe> | Defines an inline frame |
<img> | Defines an image |
<input> | Defines an input control |
<ins> | Defines a text that has been inserted into a document |
<kbd> | Defines keyboard input |
![]() |
Defines a key-pair generator field (for forms) |
<label> | Defines a label for an <input> element |
<legend> | Defines a caption for a <fieldset> element |
<li> | Defines a list item |
<link> | Defines the relationship between a document and an external resource (most used to link to style sheets) |
![]() |
Specifies the main content of a document |
<map> | Defines a client-side image-map |
![]() |
Defines marked/highlighted text |
<menu> | Defines a list/menu of commands |
![]() |
Defines a command/menu item that the user can invoke from a popup menu |
><meta> | Defines metadata about an HTML document | '
![]() |
Defines a scalar measurement within a known range (a gauge) |
![]() |
Defines navigation links |
<noframes> | Not supported in HTML5. Defines an alternate content for users that do not support frames |
<noscript> | Defines an alternate content for users that do not support client-side scripts |
<object> | Defines an embedded object |
<ol> | Defines an ordered list |
<optgroup> | Defines a group of related options in a drop-down list |
<option> | Defines an option in a drop-down list |
![]() |
Defines the result of a calculation |
<p> | Defines a paragraph |
<param> | Defines a parameter for an object |
<pre> | Defines preformatted text |
![]() |
Represents the progress of a task |
<q> | Defines a short quotation |
![]() |
Defines what to show in browsers that do not support ruby annotations |
![]() |
Defines an explanation/pronunciation of characters (for East Asian typography) |
![]() |
Defines a ruby annotation (for East Asian typography) |
<s> | Defines text that is no longer correct |
<samp> | Defines sample output from a computer program |
<script> | Defines a client-side script |
![]() |
Defines a section in a document |
<select> | Defines a drop-down list |
<small> | Defines smaller text |
![]() |
Defines multiple media resources for media elements (<video> and <audio>) |
<span> | Defines a section in a document |
<strike> | Not supported in HTML5. Use <del> or
<s> instead. Defines strikethrough text |
<strong> | Defines important text |
<style> | Defines style information for a document |
<sub> | Defines subscripted text |
![]() |
Defines a visible heading for a <details> element |
<sup> | Defines superscripted text |
<table> | Defines a table |
<tbody> | Groups the body content in a table |
<td> | Defines a cell in a table |
<textarea> | Defines a multiline input control (text area) |
<tfoot> | Groups the footer content in a table |
<th> | Defines a header cell in a table |
<thead> | Groups the header content in a table |
![]() |
Defines a date/time |
<title> | Defines a title for the document |
<tr> | Defines a row in a table |
![]() |
Defines text tracks for media elements (<video> and <audio>) |
<tt> | Not supported in HTML5. Use CSS
instead. Defines teletype text |
<u> | Defines text that should be stylistically different from normal text |
<ul> | Defines an unordered list |
<var> | Defines a variable |
![]() |
Defines a video or movie |
![]() |
Defines a possible line-break |
The <link> tag defines a link between a document and an external resource.
The <link> tag is used to link to external style sheets.
Link to an external style sheet:
When used for style sheets, the <link> tag is supported in all major browsers. No real support for anything else.
Element |
![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|---|
<link> | Yes | Yes | Yes | Yes | Yes |
Note: The <link> element is an empty element, it contains attributes only.
Note: This element goes only in the head section, but it can appear any number of times.
Some HTML 4.01 attributes are not supported in HTML5.
The "sizes" attribute is new in HTML5.
In HTML the <link> tag has no end tag.
In XHTML the <link> tag must be properly closed.
= New in HTML5.
Attribute | Value | Description |
---|---|---|
charset | char_encoding | Not supported in HTML5. Specifies the character encoding of the linked document |
![]() |
anonymous use-credentials |
Specifies how the element handles cross-origin requests |
href | URL | Specifies the location of the linked document |
hreflang | language_code | Specifies the language of the text in the linked document |
media | media_query | Specifies on what device the linked document will be displayed |
rel | alternate archives author bookmark external first help icon last license next nofollow noreferrer pingback prefetch prev search sidebar stylesheet tag up |
Required. Specifies the relationship between the current document and the linked document |
rev | reversed relationship | Not supported in HTML5. Specifies the relationship between the linked document and the current document |
![]() |
HeightxWidth any |
Specifies the size of the linked resource. Only for rel="icon" |
target | _blank _self _top _parent frame_name |
Not supported in HTML5. Specifies where the linked document is to be loaded |
type | media_type | Specifies the media type of the linked document |
The <link> tag also supports the Global Attributes in HTML.
The <link> tag also supports the Event Attributes in HTML.
HTML tutorial: HTML Styles
HTML DOM reference: Link Object
Most browsers will display the <link> element with the following default values:
The <style> tag is used to define style information for an HTML document.
Inside the <style> element you specify how HTML elements should render in a browser.
Each HTML document can contain multiple <style> tags.
Use of the <style> element in an HTML document:
Element |
![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|---|
<style> | Yes | Yes | Yes | Yes | Yes |
Tip: To link to an external style sheet, use the <link> tag.
Tip: To learn more about style sheets, please read our CSS Tutorial.
Note: If the "scoped" attribute is not used, each <style> tag must be located in the head section.
The "scoped" attribute is new in HTML5, which allows to define styles for a specified section of the document. If the "scoped" attribute is present, the styles only apply to the style element's parent element and that element's child elements.
= New in HTML5.
Attribute | Value | Description |
---|---|---|
media | media_query | Specifies what media/device the media resource is optimized for |
![]() |
scoped | Specifies that the styles only apply to this element's parent element and that element's child elements |
type | text/css | Specifies the media type of the <style> tag |
The <style> tag also supports the Global Attributes in HTML.
The <style> tag also supports the Event Attributes in HTML.
HTML tutorial: HTML CSS
CSS tutorial: CSS Tutorial
HTML DOM reference: Style Object
Most browsers will display the <style> element with the following default values:
The <iframe> tag specifies an inline frame.
An inline frame is used to embed another document within the current HTML document.
An inline frame is marked up as follows:
Element |
![]() |
![]() |
![]() |
![]() |
![]() |
|
---|---|---|---|---|---|---|
<iframe> | Yes | Yes | Yes | Yes | Yes | Yes |
Tip: To deal with browsers that do not support <iframe>, add a text between the opening <iframe> tag and the closing </iframe> tag.
Tip: Use CSS to style the <iframe> (even to include scrollbars).
HTML5 has added some new attributes, and several HTML 4.01 attributes are removed from HTML5.
In XHTML, the name attribute is deprecated, and will be removed. Use the global id attribute instead.
= New in HTML5.
Attribute | Value | Description |
---|---|---|
align | left right top middle bottom |
Not supported in HTML5. Specifies the alignment of an <iframe> according to surrounding elements |
frameborder | 1 0 |
Not supported in HTML5. Specifies whether or not to display a border around an <iframe> |
height | pixels | Specifies the height of an <iframe> |
longdesc | URL | Not supported in HTML5. Specifies a page that contains a long description of the content of an <iframe> |
marginheight | pixels | Not supported in HTML5. Specifies the top and bottom margins of the content of an <iframe> |
marginwidth | pixels | Not supported in HTML5. Specifies the left and right margins of the content of an <iframe> |
name | text | Specifies the name of an <iframe> |
![]() |
allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-top-navigation |
Enables an extra set of restrictions for the content in an <iframe> |
scrolling | yes no auto |
Not supported in HTML5. Specifies whether or not to display scrollbars in an <iframe> |
src | URL | Specifies the address of the document to embed in the <iframe> |
![]() |
HTML_code | Specifies the HTML content of the page to show in the <iframe> |
width | pixels | Specifies the width of an <iframe> |
The <iframe> tag also supports the Global Attributes in HTML.
The <iframe> tag also supports the Event Attributes in HTML.
HTML tutorial: HTML Iframes
HTML DOM reference: IFrame Object
Most browsers will display the <iframe> element with the following default values: