Hyperlink tag description in HTML

零下一度
Release: 2017-05-04 11:01:35
Original
3281 people have browsed it

This article mainly introduces the tutorial on how to use the hyperlink tag in HTML, including how to use email links. Friends in need can refer to the various

HTML of the

website Documents are connected to each other through hyperlinks to form a coherent website. Users can jump to the page they want to browse by clicking on the hyperlink. Therefore, hyperlinks can be seen in any website and are the core component of connecting websites to form a whole.

Arrangement of anchor point
HTML hyperlinks are triggered with the tag as the anchor point. The anchor point needs to have a carrier, and this carrier It can be a text, a word, a sentence, an image or a shape. When the mouse moves to a carrier with an anchor point, the mouse will turn into a small hand, indicating that the user can click. After the user clicks on the anchor point, it will jump to the address corresponding to the href in the tag. .

Usage of jump attribute
In
HTML link, you can use the href attribute to create a link to another document, usually used for page jumps. This is very common and will not be explained again.
Use the name attribute to create a bookmark inside the document so that a hyperlink can jump to a certain part of the page within the document. For example: set to place it in the middle of the page. Then set the jump to the middle of the page anchor point at the head of the page. When the user clicks this anchor point at the head of the page, the page will scroll and jump to the name bookmark. The location is in the middle of the page.

HTML link syntax
HTML link code is very simple to use. For example:

XML/HTML CodeCopy content to clipboard

  1. <a href=”url”>
    锚文本链接
    </a>
    Copy after login

The href attribute is used to set the jump target. The text between the start tag and the end tag is displayed as a hyperlink.

The target attribute of HTML link
The target attribute can set the opening method of the page after clicking on the anchor text. There are 4 reserved target names used for special document redirection operations:
_blank
The browser always loads the target document in a newly opened, unnamed window.
_self
The value of this target is the default target for all tags that do not specify a target, which causes the target document to be loaded and displayed in the same frame or window as the source document . This target is redundant and unnecessary unless used in conjunction with the target attribute in the tag of the document title.
_parent
This target causes the document to be loaded into the parent window or frameset containing the frame that is referenced by the hyperlink . If this reference is in a window or in a top-level frame, it is equivalent to target _self. _top
This goal causes the document to load into the window containing the hyperlink. Using the _top goal will clear all contained frames and load the document into the entire browser window. Generally used to click the anchor point in the
iframe frame. The target link is opened directly on the current page instead of loading in the iframe.

HTML link triggers desktop software to send emails
Add an address starting with mailto: in the href attribute, and combine it with the target email address to directly call the default in the user's computer Email management software that automatically fills in content and sends emails.
There are many websites where you can directly click on the email address and the interface for sending emails will pop up.
The email hyperlink code is as follows:

XML/HTML CodeCopy the content to the clipboard

    <a href=
    "mailto:email地址">
    EMAIL
    </a>
    Copy after login
For example:

XML/HTML CodeCopy content to clipboard

    <a href=
    "mailto:admin@myxzy.com">
    站长邮箱
    </a>
    Copy after login
Note: Since the address is published directly, there may be a lot of spam. It is recommended not to use this email hyperlink.

This admin@myxzy.com mailbox receives spam every day because I wrote the address here.
Even if you want to indicate the email address without making a hyperlink, do not write it directly on the website or web page with text. You can use pictures or other methods to represent the address
Complex links:

XML/HTML CodeCopy content to clipboard

  1. <a href=
    "Mailto:ghsau@163.com?CC=ghsau@163.com&BCC=ghsau@163.com&Subject=Hello&Body=你好">
    给我发邮件
    </a>
    Copy after login

其语法主要由以下几个部分组成
mailto: (发送邮件到) 后面跟随邮箱地址,例如:my@frontopen.com
? (分隔符)用于在地址后面跟随相应的参数
&;  (参数连接符)同时设置多个参数时,需要用&符号进行区分连接
cc= 、 bcc=(抄送),后面跟随需要抄送人的邮箱地址,例如:my@frontopen.com
subject=  (邮件主题)后面跟随你的邮件主题
body= (邮件内容)后面跟随需要的邮件内容

The above is the detailed content of Hyperlink tag description in HTML. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!