Horje
What is HTML <a> Tag

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

Example of HTML <a> Tag

Create a link to Horje.com:
 <a href="https://horje.com">Visit Horje.com!</a> 

Output should be:

Example of HTML <a> Tag

Tips and Notes for HTML <a> Tag

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.

Browser Support for HTML <a> Tag

Output should be:

Browser Support for HTML <a> Tag

<a> Tag Attributes

Attribute Value Description
download filename Specifies that the target will be downloaded when a user clicks on the hyperlink
href URL Specifies the URL of the page the link goes to
hreflang language_code Specifies the language of the linked document
media media_query Specifies what media/device the linked document is optimized for
ping list_of_URLs Specifies 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.
referrerpolicy no-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
rel alternate
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
type media_type Specifies the media type of the linked document

<a> Global Attributes

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

<a> Event Attributes

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

How to use an image as a link

An image as a link:
index.html
Example: HTML
 <a href="https://www.w3schools.com">
<img border="0" alt="W3Schools" src="logo_w3s.gif" width="100" height="100">
</a> 

Output should be:

How to use an image as a link

How to open a link in a new browser window

<a href="https://horje.com" target="_blank">Visit Horje.com!</a> 

Output should be:

How to open a link in a new browser window

How to link to an email address

To create a link that opens in the user's email program (to let them send a new email), use mailto: inside the href attribute:
index.html
Example: HTML
<a href="mailto:[email protected]">Send email</a>

Output should be:

How to link to an email address

How to link to another section on the same page

index.html
Example: HTML
 <a href="#section2">Go to Section 2</a>
<h2 id="section2">Section 2</h2>

How to link to a JavaScript

index.html
Example: HTML
<a href="javascript:alert('Hello World!');">Execute JavaScript</a> 

Output should be:

How to link to a JavaScript

How to add HTML <a> download Attribute

Download file when clicking on the link (instead of navigating to the file):

Definition and Usage

The download attribute specifies that the target (the file specified in the href attribute) will be downloaded when a user clicks on the hyperlink.

The optional value of the download attribute will be the new name of the file after it is downloaded. There are no restrictions on allowed values, and the browser will automatically detect the correct file extension and add it to the file (.img, .pdf, .txt, .html, etc.).

If the value is omitted, the original filename is used.

Browser Support

The numbers in the table specify the first browser version that fully supports the attribute.

Syntax

<a download="filename">

Attribute Values

Value Description
filename Optional. Specifies the new filename for the downloaded file
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h1>The a download attribute</h1>

<p>Click on the image to download it:<p>
<a href="https://horje.com/avatar.png" download>
  <img src="https://horje.com/avatar.png" alt="Horje" width="104" height="142">
</a>

<p><b>Note:</b> The download attribute is not supported in IE or Edge (prior version 18), or in Safari (prior version 10.1).</p>

</body>
</html>

Output should be:

How to add HTML <a> download Attribute

How to add HTML <a> href Attribute

The href attribute specifies the link's destination:

Definition and Usage

The href attribute specifies the URL of the page the link goes to.

If the href attribute is not present, the <a> tag will not be a hyperlink.

Tip: You can use href="#top" or href="#" to link to the top of the current page!

Browser Support

Syntax

<a href="URL">

Attribute Values

Value Description
URL The URL of the link.

Possible values:

  • An absolute URL - points to another web site (like href="http://www.example.com/default.htm")
  • A relative URL - points to a file within a web site (like href="default.htm")
  • Link to an element with a specified id within the page (like href="#section2")
  • Other protocols (like https://, ftp://, mailto:, file:, etc..)
  • A script (like href="javascript:alert('Hello');")
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h1>The a href attribute</h1>

<p>An absolute URL: <a href="https://horje.com/">Horje</a></p>
<p>A relative URL: <a href="tag_a.asp">The a tag</a></p>

</body>
</html>

Output should be:

How to add HTML <a> href Attribute

How to add HTML <a> hreflang Attribute

The hreflang attribute specifies the language of the document in the link:

Definition and Usage

The hreflang attribute specifies the language of the linked document.

This attribute is only used if the href attribute is set.

Note: This attribute is purely advisory.

Browser Support

Syntax

<a hreflang="language_code">

Attribute Values

Value Description
language_code A two-letter language code that specifies the language of the linked document.
To view all available language codes, go to our Language code reference.

 

index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h1>The a hreflang attribute</h1>

<p><a hreflang="en" href="https://horje.com">Horje.com</a></p>

</body>
</html>

Output should be:

How to add HTML <a> hreflang Attribute

How to add HTML <a> media Attribute

A link with a media attribute.

Definition and Usage

The media attribute specifies what media or device the linked document is optimized for.

This attribute is used to specify that the target URL is designed for special devices (like iPhone), speech or print media.

This attribute can accept several values.

Only used if the href attribute is present.

Note: This attribute is purely advisory.

Browser Support

Syntax

<a media="value">

Possible Operators

Value Description
and Specifies an AND operator
not Specifies a NOT operator
, Specifies an OR operator

Devices

Value Description
all Default. Suitable for all devices
aural Speech synthesizers
braille Braille feedback devices
handheld Handheld devices (small screen, limited bandwidth)
projection Projectors
print Print preview mode/printed pages
screen Computer screens
tty Teletypes and similar media using a fixed-pitch character grid
tv Television type devices (low resolution, limited scroll ability)

Values

Value Description
width Specifies the width of the targeted display area.
"min-" and "max-" prefixes can be used.
Example: media="screen and (min-width:500px)"
height Specifies the height of the  targeted display area.
"min-" and "max-" prefixes can be used.
Example: media="screen and (max-height:700px)"
device-width Specifies the width of the target display/paper.
"min-" and "max-" prefixes can be used.
Example: media="screen and (device-width:500px)"
device-height Specifies the height of the target display/paper.
"min-" and "max-" prefixes can be used.
Example: media="screen and (device-height:500px)"
orientation Specifies the orientation of the target display/paper.
Possible values: "portrait" or "landscape"
Example: media="all and (orientation: landscape)"
aspect-ratio Specifies the width/height ratio of the targeted display area.
"min-" and "max-" prefixes can be used.
Example: media="screen and (aspect-ratio:16/9)"
device-aspect-ratio Specifies the device-width/device-height ratio of the target display/paper.
"min-" and "max-" prefixes can be used.
Example: media="screen and (aspect-ratio:16/9)"
color Specifies the bits per color of target display.
"min-" and "max-" prefixes can be used.
Example: media="screen and (color:3)"
color-index Specifies the number of colors the target display can handle.
"min-" and "max-" prefixes can be used.
Example: media="screen and (min-color-index:256)"
monochrome Specifies the bits per pixel in a monochrome frame buffer.
"min-" and "max-" prefixes can be used.
Example: media="screen and (monochrome:2)"
resolution Specifies the pixel density (dpi or dpcm) of the target display/paper.
"min-" and "max-" prefixes can be used.
Example: media="print and (resolution:300dpi)"
scan Specifies scanning method of a tv display.
Possible values are "progressive" and "interlace".
Example: media="tv and (scan:interlace)"
grid Specifies if the output device is grid or bitmap.
Possible values are "1" for grid, and "0" otherwise.
Example: media="handheld and (grid:1)"
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h1>The a media attribute</h1>

<p>
<a href="https://horje.com/" media="print and (resolution:300dpi)">Open media attribute page for print</a>
</p>

</body>
</html>

Output should be:

How to add HTML <a> media Attribute

How to add HTML <a> media height Attribute

Specifies the height of the  targeted display area.
"min-" and "max-" prefixes can be used.
Example: media="screen and (max-height:700px)"

index.html
Example: HTML
<a href="att_a_media.asp?output=print"
media="screen and (max-height:700px)">
Open media attribute page for print.</a> 

Output should be:

How to add HTML <a> media height Attribute

How to add HTML <a> media device-width Attribute

Specifies the width of the target display/paper.
"min-" and "max-" prefixes can be used.
Example: media="screen and (device-width:500px)"

index.html
Example: HTML
<a href="att_a_media.asp?output=print"
media="screen and (device-width:500px)">
Open media attribute page for print.</a> 

Output should be:

How to add HTML <a> media device-width Attribute

How to add HTML <a> media width Attribute

Specifies the width of the targeted display area.
"min-" and "max-" prefixes can be used.
Example: media="screen and (min-width:500px)"

<a href="att_a_media.asp?output=print"
media="print and (resolution:300dpi)">
Open media attribute page for print.</a>

Output should be:

How to add HTML <a> media width Attribute

How to add HTML <a> media device-height Attribute

Specifies the height of the target display/paper.
"min-" and "max-" prefixes can be used.
Example: media="screen and (device-height:500px)"

index.html
Example: HTML
<a href="att_a_media.asp?output=print"
media="screen and (device-height:500px)">
Open media attribute page for print.</a>

Output should be:

How to add HTML <a> media device-height Attribute

How to add HTML <a> media orientation Attribute

Specifies the orientation of the target display/paper.
Possible values: "portrait" or "landscape"
Example: media="all and (orientation: landscape)"

index.html
Example: HTML
<a href="att_a_media.asp?output=print"
media="all and (orientation: landscape)">
Open media attribute page for print.</a>

Output should be:

How to add HTML <a> media orientation Attribute

How to add HTML <a> media aspect-ratio Attribute

Specifies the width/height ratio of the targeted display area.
"min-" and "max-" prefixes can be used.
Example: media="screen and (aspect-ratio:16/9)"

index.html
Example: HTML
<a href="att_a_media.asp?output=print"
media="screen and (aspect-ratio:16/9)">
Open media attribute page for print.</a>

Output should be:

How to add HTML <a> media aspect-ratio Attribute

How to add HTML <a> media device-aspect-ratio Attribute

Specifies the device-width/device-height ratio of the target display/paper.
"min-" and "max-" prefixes can be used.
Example: media="screen and (aspect-ratio:16/9)"

index.html
Example: HTML
<a href="att_a_media.asp?output=print"
media="screen and (aspect-ratio:16/9)">
Open media attribute page for print.</a>

Output should be:

How to add HTML <a> media device-aspect-ratio Attribute

How to add HTML <a> media color Attribute

Specifies the bits per color of target display.
"min-" and "max-" prefixes can be used.
Example: media="screen and (color:3)"

index.html
Example: HTML
<a href="att_a_media.asp?output=print"
media="screen and (color:3)">
Open media attribute page for print.</a>

Output should be:

How to add HTML <a> media color Attribute

How to add HTML <a> media color-index Attribute

Specifies the number of colors the target display can handle.
"min-" and "max-" prefixes can be used.
Example: media="screen and (min-color-index:256)"

index.html
Example: HTML
<a href="https://horje.com/view/1367/how-to-add-html-a-media-aspect-ratio-attribute"
media="screen and (min-color-index:256)">
Open media attribute page for print.</a>

Output should be:

How to add HTML <a> media color-index Attribute

How to add HTML <a> media monochrome Attribute

Specifies the bits per pixel in a monochrome frame buffer.
"min-" and "max-" prefixes can be used.
Example: media="screen and (monochrome:2)"

index.html
Example: HTML
<a href="https://horje.com/view/1367/how-to-add-html-a-media-aspect-ratio-attribute"
media="screen and (monochrome:2)">
Open media attribute page for print.</a>

Output should be:

How to add HTML <a> media monochrome Attribute

How to add HTML <a> media resolution Attribute

Specifies the pixel density (dpi or dpcm) of the target display/paper.
"min-" and "max-" prefixes can be used.
Example: media="print and (resolution:300dpi)"

index.html
Example: HTML
<a href="att_a_media.asp?output=print"
media="print and (resolution:300dpi)">
Open media attribute page for print.</a>

Output should be:

How to add HTML <a> media resolution Attribute

How to add HTML <a> media monochrome Attribute

Specifies scanning method of a tv display.
Possible values are "progressive" and "interlace".
Example: media="tv and (scan:interlace)"

index.html
Example: HTML
<a href="att_a_media.asp?output=print"
media="tv and (scan:interlace)">
Open media attribute page for print.</a>

Output should be:

How to add HTML <a> media monochrome Attribute

How to add HTML <a> media grid Attribute

Specifies if the output device is grid or bitmap.
Possible values are "1" for grid, and "0" otherwise.
Example: media="handheld and (grid:1)"

index.html
Example: HTML
<a href="att_a_media.asp?output=print"
media="handheld and (grid:1)">
Open media attribute page for print.</a>

Output should be:

How to add HTML <a> media grid Attribute

How to add HTML <a> ping Attribute

Notify https://horje.com, when a user clicks on the link.

Definition and Usage

The ping attribute specifies a list of URLs to be notified if the user follows the hyperlink.

When the user clicks on the hyperlink, the ping attribute will send a short HTTP POST request to the specified URL.

This attribute is useful for monitoring/tracking.

Browser Support

The numbers in the table specify the first browser version that fully supports the attribute.

Syntax

<a ping="URL">

Attribute Values

Value Description
URL Specifies the URL to be notified if the user follows the hyperlink. Must be a space separated list of one or more valid URLs
index.html
Example: HTML
 <a href="https://horje.com/" ping="https://horje.com/"> 

How to add HTML <a> referrerpolicy Attribute

Set the referrerpolicy for a link.

Definition and Usage

The referrerpolicy attribute specifies which referrer information to send when the user clicks on the hyperlin


Browser Support

The numbers in the table specify the first browser version that fully supports the attribute.

Syntax

<a referrerpolicy="no-referrer|no-referrer-when-downgrade|origin|origin-when-cross-origin|same-origin|strict-origin-when-cross-origin|unsafe-url">

Attribute Values

Value Description
no-referrer No referrer information is sent
no-referrer-when-downgrade Default. Sends the origin, path, and query string if the protocol security level stays the same or is higher (HTTP to HTTP, HTTPS to HTTPS, HTTP to HTTPS is ok). Sends nothing to less secure level (HTTPS to HTTP is not ok)
origin Sends the origin (scheme, host, and port) of the document
origin-when-cross-origin Sends the origin of the document for cross-origin request. Sends the origin, path, and query string for same-origin request
same-origin Sends a referrer for same-origin request. Sends no referrer for cross-origin request
strict-origin-when-cross-origin Sends the origin if the protocol security level stays the same or is higher (HTTP to HTTP, HTTPS to HTTPS, and HTTP to HTTPS is ok). Sends nothing to less secure level (HTTPS to HTTP)
unsafe-url Sends the origin, path, and query string (regardless of security). Use this value carefully!
index.html
Example: HTML
<a href="https://horje.com/" referrerpolicy="origin">WWE</a>

Output should be:

How to add HTML <a> referrerpolicy Attribute

How to add HTML <a> referrerpolicy no-referrer Attribute

no-referrer No referrer information is sent
index.html
Example: HTML
<a href="https://horje.com/" referrerpolicy="no-referrer">Open A Link</a>

Output should be:

How to add HTML <a> referrerpolicy no-referrer Attribute

How to add HTML <a> Tag referrerpolicy no-referrer-when-downgrade Attribute

Default. Sends the origin, path, and query string if the protocol security level stays the same or is higher (HTTP to HTTP, HTTPS to HTTPS, HTTP to HTTPS is ok). Sends nothing to less secure level (HTTPS to HTTP is not ok)

index.html
Example: HTML
<a href="https://horje.com/" referrerpolicy="no-referrer-when-downgrade">Open a Link</a>

Output should be:

How to add HTML <a> Tag referrerpolicy no-referrer-when-downgrade Attribute

How to add HTML <a> Tag referrerpolicy origin Attribute

Sends the origin (scheme, host, and port) of the document

index.html
Example: HTML
<a href="https://horje.com/" referrerpolicy="origin">Open a Link</a>

Output should be:

How to add HTML <a> Tag referrerpolicy origin Attribute

How to add HTML <a> Tag referrerpolicy origin-when-cross-origin Attribute

Sends the origin of the document for cross-origin request. Sends the origin, path, and query string for same-origin request.

index.html
Example: HTML
<a href="https://horje.com/" referrerpolicy="origin-when-cross-origin">Open a Link</a>

Output should be:

How to add HTML <a> Tag referrerpolicy origin-when-cross-origin Attribute

How to add HTML <a> Tag referrerpolicy same-origin Attribute

Sends a referrer for same-origin request. Sends no referrer for cross-origin request.

index.html
Example: HTML
<a href="https://horje.com/" referrerpolicy="same-origin">Open a Link</a>

Output should be:

How to add HTML <a> Tag referrerpolicy same-origin Attribute

How to add HTML <a> Tag referrerpolicy strict-origin-when-cross-origin Attribute

Sends the origin if the protocol security level stays the same or is higher (HTTP to HTTP, HTTPS to HTTPS, and HTTP to HTTPS is ok). Sends nothing to less secure level (HTTPS to HTTP).

index.html
Example: HTML
<a href="https://horje.com/" referrerpolicy="strict-origin-when-cross-origin">Open a Link</a>

Output should be:

How to add HTML <a> Tag referrerpolicy strict-origin-when-cross-origin Attribute

How to add HTML <a> Tag referrerpolicy unsafe-url Attribute

Sends the origin, path, and query string (regardless of security). Use this value carefully!

index.html
Example: HTML
<a href="https://horje.com/" referrerpolicy="unsafe-url">Open a Link</a>

Output should be:

How to add HTML <a> Tag referrerpolicy unsafe-url Attribute

How to add HTML <a> rel Attribute

A link with a rel attribute.

Definition and Usage

The rel attribute specifies the relationship between the current document and the linked document.

Only used if the href attribute is present.

Tip: Search engines can use this attribute to get more information about a link!

Syntax

<a rel="value">

Attribute Values

Value Description
alternate Provides a link to an alternate representation of the document (i.e. print page, translated or mirror)
author Provides a link to the author of the document
bookmark Permanent URL used for bookmarking
external Indicates that the referenced document is not part of the same site as the current document
help Provides a link to a help document
license Provides a link to licensing information for the document
next Provides a link to the next document in the series
nofollow Links to an unendorsed document, like a paid link.
("nofollow" is used by Google, to specify that the Google search spider should not follow that link)
noopener Requires that any browsing context created by following the hyperlink must not have an opener browsing context
noreferrer Makes the referrer unknown. No referer header will be included when the user clicks the hyperlink
prev The previous document in a selection
search Links to a search tool for the document
tag A tag (keyword) for the current document
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h1>The a rel attribute</h1>

<p><a rel="nofollow" href="https://horje.com/">Horje.com</a></p>

</body>
</html>

Output should be:

How to add HTML <a> rel Attribute

How to use HTML <a>Tag rel alternate Attribute

Provides a link to an alternate representation of the document (i.e. print page, translated or mirror).

index.html
Example: HTML
<a rel="alternate" href="https://horje.com">Horje.com</a>

Output should be:

How to use HTML <a>Tag rel alternate Attribute

How to use HTML <a>Tag rel author Attribute

Provides a link to the author of the document.

index.html
Example: HTML
<a rel="author" href="https://horje.com">Horje.com</a>

Output should be:

How to use HTML <a>Tag rel author Attribute

How to use HTML <a>Tag rel bookmark Attribute

Permanent URL used for bookmarking.

index.html
Example: HTML
<a rel="bookmark" href="https://horje.com">Horje.com</a>

Output should be:

How to use HTML <a>Tag rel bookmark Attribute

How to use HTML <a>Tag rel external Attribute

Indicates that the referenced document is not part of the same site as the current document.

index.html
Example: HTML
<a rel="external" href="https://horje.com">Horje.com</a>

Output should be:

How to use HTML <a>Tag rel external Attribute

How to use HTML <a>Tag rel help Attribute

Provides a link to a help document.

index.html
Example: HTML
<a rel="help" href="https://horje.com">Horje.com</a>

Output should be:

How to use HTML <a>Tag rel help Attribute

How to use HTML <a>Tag rel license Attribute

Provides a link to licensing information for the document.

index.html
Example: HTML
<a rel="license" href="https://horje.com/">Horje.com</a>

Output should be:

How to use HTML <a>Tag rel license Attribute

How to use HTML <a>Tag rel next Attribute

Provides a link to the next document in the series.

index.html
Example: HTML
<a rel="next" href="https://horje.com/">Horje.com</a>

Output should be:

How to use HTML <a>Tag rel next Attribute

How to use HTML <a>Tag rel nofollow Attribute

Links to an unendorsed document, like a paid link.
("nofollow" is used by Google, to specify that the Google search spider should not follow that link)

index.html
Example: HTML
<a rel="nofollow" href="https://horje.com/">Horje.com</a>

Output should be:

How to use HTML <a>Tag rel nofollow Attribute

How to use HTML <a>Tag rel noopener Attribute

Requires that any browsing context created by following the hyperlink must not have an opener browsing context.

index.html
Example: HTML
<a rel="noopener" href="https://horje.com/">Horje.com</a>

Output should be:

How to use HTML <a>Tag rel noopener Attribute

How to use HTML <a>Tag rel noreferrer Attribute

Makes the referrer unknown. No referer header will be included when the user clicks the hyperlink.

index.html
Example: HTML
<a rel="noreferrer" href="https://horje.com/">Horje.com</a>

Output should be:

How to use HTML <a>Tag rel noreferrer Attribute

How to use HTML <a>Tag rel prev Attribute

The previous document in a selection.

index.html
Example: HTML
<a rel="prev" href="https://horje.com/">Horje.com</a>

Output should be:

How to use HTML <a>Tag rel prev Attribute

How to use HTML <a>Tag rel search Attribute

Links to a search tool for the document.

index.html
Example: HTML
<a rel="search" href="https://horje.com/">Horje.com</a>

Output should be:

How to use HTML <a>Tag rel search Attribute

How to use HTML <a>Tag rel tag Attribute

A tag (keyword) for the current document.

index.html
Example: HTML
<a rel="tag" href="https://horje.com/">Horje.com</a>

Output should be:

How to use HTML <a>Tag rel tag Attribute

How to create HTML <a> target Attribute

The target attribute specifies where to open the linked document.

Definition and Usage

The target attribute specifies where to open the linked document.

Browser Support

Syntax

<a target="_blank|_self|_parent|_top|framename">

Attribute Values

Value Description
_blank Opens the linked document in a new window or tab
_self Opens the linked document in the same frame as it was clicked (this is default)
_parent Opens the linked document in the parent frame
_top Opens the linked document in the full body of the window
framename Opens the linked document in the named iframe
index.html
<!DOCTYPE html>
<html>
<body>

<h1>The a target attribute</h1>

<p>Open link in a new window or tab: <a href="https://horje.com" target="_blank">Visit Horje!</a></p>

</body>
</html>

Output should be:

How to create HTML <a> target Attribute

How to add HTML <a> target _blank Attribute

Opens the linked document in a new window or tab.

index.html
Example: HTML
<a href="https://horje.com" target="_blank">Visit Horje!</a>

Output should be:

How to add HTML <a> target _blank Attribute

How to add HTML <a> target _self Attribute

Opens the linked document in the same frame as it was clicked (this is default).

index.html
Example: HTML
<a href="https://horje.com" target="_self">Visit Horje!</a>

Output should be:

How to add HTML <a> target _self Attribute

How to add HTML <a> target _parent Attribute

Opens the linked document in the parent frame.

index.html
Example: HTML
<a href="https://horje.com" target="_parent">Visit Horje!</a>

Output should be:

How to add HTML <a> target _parent Attribute

How to add HTML <a> target _top Attribute

Opens the linked document in the full body of the window.

index.html
Example: HTML
<a href="https://horje.com" target="_top">Visit Horje!</a>

Output should be:

How to add HTML <a> target _top Attribute

How to add HTML <a> target framename Attribute

Opens the linked document in the named iframe.

index.html
Example: HTML
<a href="https://horje.com" target="framename">Visit Horje!</a>

Output should be:

How to add HTML <a> target framename Attribute

How to create HTML <a> type Attribute

The type attribute specifies the media type of the linked document:.

Definition and Usage

The type attribute specifies the Internet media type (formerly known as MIME type) of the linked document.

This attribute is only used if the href attribute is set.

Note: This attribute is purely advisory.

Browser Support

Syntax

<a type="media_type">

Attribute Values

Value Description
media_type The Internet media type of the linked document.
Look at IANA Media Types for a complete list of standard media types.
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h1>The a type attribute</h1>

<p>
<a href="https://horje.com" type="text/html">Horje.com</a>
</p>

</body>
</html>

Output should be:

How to create HTML <a> type Attribute





Related Articles
What is HTML <!--...--> Tag HTML Tag
What is HTML <!DOCTYPE> Declaration HTML Tag
What is HTML Elements and Doctypes HTML Tag
What is HTML <a> Tag HTML Tag
What is HTML <abbr> Tag HTML Tag
What is HTML <acronym> Tag HTML Tag
What is HTML <address> Tag HTML Tag
What is HTML <applet> Tag HTML Tag
What is HTML <area> Tag HTML Tag
What is HTML <article> Tag HTML Tag
What is HTML <aside> Tag HTML Tag
What is HTML <audio> Tag HTML Tag
What is HTML <b> Tag HTML Tag
What is HTML <base> Tag HTML Tag
What is HTML <basefont> Tag HTML Tag
What is HTML <bdi> Tag HTML Tag
What is HTML <bdo> Tag HTML Tag
What is HTML <big> Tag HTML Tag
What is HTML <blockquote> Tag HTML Tag
What is HTML <body> Tag HTML Tag
What is HTML <br> Tag HTML Tag
What is HTML <button> Tag HTML Tag
What is HTML <canvas> Tag HTML Tag
What is HTML <caption> Tag HTML Tag
What is HTML <center> Tag HTML Tag
What is HTML <cite> Tag HTML Tag
What is HTML <code> Tag HTML Tag
What is HTML <col> Tag HTML Tag
How to create HTML <colgroup> Tag HTML Tag
What is HTML <data> Tag HTML Tag
What is HTML <datalist> Tag HTML Tag
What is HTML <dd> Tag HTML Tag
What is HTML <del> Tag HTML Tag
What is HTML <details> Tag HTML Tag
What is HTML <dfn> Tag HTML Tag
What is HTML <dialog> Tag HTML Tag
What is HTML <dir> Tag HTML Tag
What is HTML <div> Tag HTML Tag
What is HTML <dl> Tag HTML Tag
What is HTML <dt> Tag HTML Tag
What is HTML <em> Tag HTML Tag
What is HTML <embed> Tag HTML Tag
What is HTML <fieldset> Tag HTML Tag
What is HTML <figcaption> Tag HTML Tag
What is HTML <figure> Tag HTML Tag
What is HTML <font> Tag HTML Tag
What is HTML <footer> Tag HTML Tag
What is HTML <form> Tag HTML Tag
What is HTML <frame> Tag HTML Tag
What is HTML <frameset> Tag HTML Tag
What is HTML <h1> to <h6> Tags HTML Tag
What is HTML <head> Tag HTML Tag
What is HTML <header> Tag HTML Tag
What is HTML <hgroup> Tag HTML Tag
What is HTML <hr> Tag HTML Tag
What is HTML <html> Tag HTML Tag
What is HTML <i> Tag HTML Tag
What is HTML <iframe> Tag HTML Tag
What is HTML <img> Tag HTML Tag
What is HTML <input> Tag HTML Tag
What is HTML <ins> Tag HTML Tag
What is HTML <kbd> Tag HTML Tag
What is HTML <label> Tag HTML Tag
What is HTML <legend> Tag HTML Tag
What is HTML <li> Tag HTML Tag
What is HTML <link> Tag HTML Tag
What is HTML <main> Tag HTML Tag
What is HTML <map> Tag HTML Tag
What is HTML <mark> Tag HTML Tag
What is HTML <menu> Tag HTML Tag
What is HTML <meta> Tag HTML Tag
What is HTML <meter> Tag HTML Tag
What is HTML <nav> Tag HTML Tag
What is HTML <noframes> Tag HTML Tag
What is HTML <noscript> Tag HTML Tag
What is HTML <object> Tag HTML Tag
What is HTML <ol> Tag HTML Tag
What is HTML <optgroup> Tag HTML Tag
What is HTML <option> Tag HTML Tag
What is HTML <output> Tag HTML Tag
What is HTML <p> Tag HTML Tag
What is HTML <param> Tag HTML Tag
What is HTML <picture> Tag HTML Tag
What is HTML <pre> Tag HTML Tag
What is HTML <progress> Tag HTML Tag
What is HTML <q> Tag HTML Tag
What is HTML <rp> Tag HTML Tag
What is HTML <rt> Tag HTML Tag
What is HTML <ruby> Tag HTML Tag
What is HTML <s> Tag HTML Tag
What is HTML <samp> Tag HTML Tag
What is HTML <script> Tag HTML Tag
What is HTML <search> Tag HTML Tag
What is HTML <section> Tag HTML Tag
What is HTML <select> Tag HTML Tag
What is HTML <small> Tag HTML Tag
What is HTML <source> Tag HTML Tag

Single Articles
Example of HTML <a> TagHTML Tag
Tips and Notes for HTML <a> TagHTML Tag
Browser Support for HTML <a> TagHTML Tag
<a> Tag AttributesHTML Tag
<a> Global AttributesHTML Tag
<a> Event AttributesHTML Tag
How to use an image as a linkHTML Tag
How to open a link in a new browser windowHTML Tag
How to link to an email addressHTML Tag
How to link to another section on the same pageHTML Tag
How to link to a JavaScriptHTML Tag
How to add HTML <a> download AttributeHTML Tag
How to add HTML <a> href AttributeHTML Tag
How to add HTML <a> hreflang AttributeHTML Tag
How to add HTML <a> media AttributeHTML Tag
How to add HTML <a> media height AttributeHTML Tag
How to add HTML <a> media device-width AttributeHTML Tag
How to add HTML <a> media width AttributeHTML Tag
How to add HTML <a> media device-height AttributeHTML Tag
How to add HTML <a> media orientation AttributeHTML Tag
How to add HTML <a> media aspect-ratio AttributeHTML Tag
How to add HTML <a> media device-aspect-ratio AttributeHTML Tag
How to add HTML <a> media color AttributeHTML Tag
How to add HTML <a> media color-index AttributeHTML Tag
How to add HTML <a> media monochrome AttributeHTML Tag
How to add HTML <a> media resolution AttributeHTML Tag
How to add HTML <a> media monochrome AttributeHTML Tag
How to add HTML <a> media grid AttributeHTML Tag
How to add HTML <a> ping AttributeHTML Tag
How to add HTML <a> referrerpolicy AttributeHTML Tag
How to add HTML <a> referrerpolicy no-referrer AttributeHTML Tag
How to add HTML <a> Tag referrerpolicy no-referrer-when-downgrade AttributeHTML Tag
How to add HTML <a> Tag referrerpolicy origin AttributeHTML Tag
How to add HTML <a> Tag referrerpolicy origin-when-cross-origin AttributeHTML Tag
How to add HTML <a> Tag referrerpolicy same-origin AttributeHTML Tag
How to add HTML <a> Tag referrerpolicy strict-origin-when-cross-origin AttributeHTML Tag
How to add HTML <a> Tag referrerpolicy unsafe-url AttributeHTML Tag
How to add HTML <a> rel AttributeHTML Tag
How to use HTML <a>Tag rel alternate AttributeHTML Tag
How to use HTML <a>Tag rel author AttributeHTML Tag
How to use HTML <a>Tag rel bookmark AttributeHTML Tag
How to use HTML <a>Tag rel external AttributeHTML Tag
How to use HTML <a>Tag rel help AttributeHTML Tag
How to use HTML <a>Tag rel license AttributeHTML Tag
How to use HTML <a>Tag rel next AttributeHTML Tag
How to use HTML <a>Tag rel nofollow AttributeHTML Tag
How to use HTML <a>Tag rel noopener AttributeHTML Tag
How to use HTML <a>Tag rel noreferrer AttributeHTML Tag
How to use HTML <a>Tag rel prev AttributeHTML Tag
How to use HTML <a>Tag rel search AttributeHTML Tag
How to use HTML <a>Tag rel tag AttributeHTML Tag
How to create HTML <a> target AttributeHTML Tag
How to add HTML <a> target _blank AttributeHTML Tag
How to add HTML <a> target _self AttributeHTML Tag
How to add HTML <a> target _parent AttributeHTML Tag
How to add HTML <a> target _top AttributeHTML Tag
How to add HTML <a> target framename AttributeHTML Tag
How to create HTML <a> type AttributeHTML Tag

Read Full:
HTML Tag
Category:
Web Tutorial
Sub Category:
HTML Tag
Uploaded:
9 months ago
Uploaded by:
Admin
Views:
9
Ref on:
View



Share on: