The main function of this label
-Create a link to another document through the hrefattribute
-Create a bookmark within the document through the name attribute
href or name is a required attribute
target attribute
An important attribute of the A tag—target,target defines where the linked document is displayed
Possible values for target are:
_blank Open a new window
_parent Displayed in the previous window
_top Displayed in the top window
name Displayed in the window named name
_self Displayed in the current window, the default attributes
_parent, _top, name must be used in combination with frame.
If the frame or window with the specified name or id does not exist, the browser will open a new window, give the window a specified tag, and then load the new document into that window. From now on, theHyperlinkdocument can point to this new window.
href attribute
# #href specifies the link address:
-Text link
百度一下
-
imageLink:
Three possible values for href:## - Absolute URL - points to another site
href="http://www.example.com/index.htm"
- Relative URL - points to a file within the site
href="index.htm"
- Anchor URL - points to an anchor in the page
href="#top"
name规定了锚的名称
相对链接
绝对链接
其他
download 规定被下载的目标,即点击后直接下载某个目标 (H5)
media 规定目标文档是专为什么样的平台设计的,没有实际作用 (H5)
type 规定了文档的mime类型,比如”text/css”
X/charset 规定链接的字符集(w3shool标记为所有浏览器不支持)
X/hreflang 规定链接文档的语言(w3shool标记为所有浏览器不支持)
The above is the detailed content of Summary of the use of all attributes of thetag in html. For more information, please follow other related articles on the PHP Chinese website!