Posts in current category
May 03, 2021 13:10 HTML5
The main purpose of HTML5 and lt;a-gt; tags is to be used for hyperlinks, which can be linked to other pages or to other files locally, and you can get to know the labels in this example below.
Link to the W3Cschool tutorial :
All major browsers support the hashtag.
Labels define hyperlinks that are used to link from one page to another.
The most important property of an element is the href property, which specifies the target of the link.
In all browsers, the default appearance of the link is as follows:
Tip: If you don't use the href property, you can't use the hreflang, media, rel, target, and type properties.
Tip: Linked pages are usually displayed in the current browser window unless additional targeting is specified.
Tip: Use CSS to change the style of the link.
In HTML 4.01, a label can be neither a hyperlink nor an anchor. In HTML5, the label is a hyperlink, but if there is no href property, it is only a placeholder for the hyperlink.
HTML5 has some new properties and no longer supports some HTML 4.01 properties.
New: The new property in HTML5.
|charset||char_encoding||HTML5 is not supported. Specifies the character encoding of the target URL.|
|coords||coordinates||HTML5 is not supported. Specifies the coordinates of the link.|
|download New||filename||Specify the download link|
|Href||Url||Specify the target URL of the link.|
|hreflang||language_code||Specifies the base language of the target URL. Use only when the href property exists.|
|media New||media_query||Specifies the media type of the target URL. D efault: all. Use only when the href property exists.|
|name||section_name||HTML5 is not supported. Specify the name of the anchor.|
|Describes the relationship between the current document and the target URL. Use only when the href property exists.|
|rev||text||HTML5 is not supported. Specify the relationship between the target URL and the current document.|
|HTML5 is not supported. Specifies the shape of the link.|
|Specify where to open the destination URL. Use only when the href property exists.|
Specifies the type of MIME for the target URL. U
se only when the href property exists.
Note: MIME - Multipurpose Internet Extension Mails.
Labels support the global properties of HTML.
The tag supports the event properties of HTML.
Create a hyperlink
This example shows how to create a link in an HTML document.
Use the image as a link
This example shows how to use an image as a link.
Open the link in a new browser window
This example shows how to open a page in a new window so that visitors don't have to leave your site.
Create an e-mail link
This example shows how to link to a message. ( This example does not work until the mail client program is installed.) ）
Create an e-mail link 2
This example demonstrates more complex mail links.
Use anchors to jump to different locations on the same page
This example shows how to use the anchor's id property to jump to a different location on the page (HTML5 does not support the name property).
HTML tutorial: HTML links
HTML DOM Reference Manual: Anchor Object