ArmenianChinese (Traditional)EnglishGermanRussian
HTML Tag -

HTML Tag

HTML

Tag

Example

Contact information for Example.com:

<address>
Written by <a href="mailto:[email protected]">Jon Doe</a>.<br>
Visit us at:<br>
Example.com<br>
Box 564, Disneyland<br>
USA
</address>
 

Definition and Usage

The <address> tag defines the contact information for the author/owner of a document or an article.

The contact information can be an email address, URL, physical address, phone number, social media handle, etc.

The text in the <address> element usually renders in italic, and browsers will always add a line break before and after the <address> element.


Global Attributes

The <address> tag also supports the Global Attributes in HTML.


Event Attributes

The <address> tag also supports the Event Attributes in HTML.


Related Pages

HTML DOM reference: Address Object


Default CSS Settings

Most browsers will display the <address> element with the following default values:

address {
  display: block;
  font-style: italic;
}

More “Try it Yourself” examples below.


Definition and Usage

The <a> tag defines a hyperlink, which is used to link from one page to another.

The most important attribute of the <a> element is the href attribute, which indicates the link’s destination.

By default, links will appear as follows in all browsers:

  • An unvisited link is underlined and blue
  • A visited link is underlined and purple
  • An active link is underlined and red

Tips and Notes

Tip: If the <a> tag has no href attribute, it is only a placeholder for a hyperlink.

Tip: A linked page is normally displayed in the current browser window, unless you specify another target.

Tip: Use CSS to style links: CSS Links and CSS Buttons.


Attributes

AttributeValueDescription
downloadfilenameSpecifies that the target will be downloaded when a user clicks on the hyperlink
hrefURLSpecifies the URL of the page the link goes to
hreflanglanguage_codeSpecifies the language of the linked document
mediamedia_querySpecifies what media/device the linked document is optimized for
pinglist_of_URLsSpecifies a space-separated list of URLs to which, when the link is followed, post requests with the body ping will be sent by the browser (in the background). Typically used for tracking.
referrerpolicyno-referrer
no-referrer-when-downgrade
origin
origin-when-cross-origin
same-origin
strict-origin-when-cross-origin
unsafe-url
Specifies which referrer information to send with the link
relalternate
author
bookmark
external
help
license
next
nofollow
noreferrer
noopener
prev
search
tag
Specifies the relationship between the current document and the linked document
target_blank
_parent
_self
_top
Specifies where to open the linked document
typemedia_typeSpecifies the media type of the linked document

 

Global Attributes

The <a> tag also supports the Global Attributes in HTML.


Event Attributes

The <a> tag also supports the Event Attributes in HTML.

More Examples

Example

How to use an image as a link:

<a href="https://www.learnprosoft.com">
<img border="0" alt="learnprosoft" src="logo_LPS.gif" width="100" height="100">
</a>

Example

How to open a link in a new browser window:

<a href="https://www.learnprosoft.com" target="_blank">Visit Learnprosoft.com!</a>

 

Example

How to link to an email address:

<a href="mailto:[email protected]">Send email</a>

 

Example

How to link to a phone number:

<a href="tel:+4733378901">+47 333 78 901</a>

 

Example

How to link to another section on the same page:

<a href="#section2">Go to Section 2</a>

 

Example

How to link to a JavaScript:

<a href="javascript:alert('Hello World!');">Execute JavaScript</a>

 

Example

How to link to an email address:

<a href="javascript:alert('Hello World!');">Execute JavaScript</a>

 

Related Pages

HTML tutorial: HTML Links

HTML DOM reference: Anchor Object

CSS Tutorial: Styling Links


Default CSS Settings

Most browsers will display the  element with the following default values:

a:link, a:visited {
  color: (internal value);
  text-decoration: underline;
  cursor: auto;
}

a:link:active, a:visited:active {
  color: (internal value);
}
ArmenianChinese (Traditional)EnglishGermanRussian