HTML5 对各个标签的定义与规定:link
May 17, 2016 am 09:10 AM- 所有全局属性
href
rel
media
hreflang
type
sizes
title(title属性对于link标签有特殊的含义)
- alternate:设置替换文档
archives:历史归档
author:文档作者
first:与当前文档同系列的第一个文档。
help:帮助文档
icon:文档图标
index:当前文档的内容表格或链接清单。
last:与当前文档同系列的最后一个文档。
license:当前文档的版权license
next:与当前文档同系列的下一个文档。
pingback:显示pingback当前文档的,pingback服务器地址。
prefetch:预加载资源
prev:与当前文档同系列的上一个文档。
search:相关的搜索页面
stylesheet:外部css样式文档
sidebar:侧边栏设置
tag:标签
up:当前文档的上下文文档
属于meta信息。
放在head中,或者head的子元素noscript中。
为空元素。
拥有属性
DOM 接口:
- 代码: 全选 运行
-
interface HTMLLinkElement : HTMLElement {<br> attribute boolean disabled;<br> attribute DOMString href;<br> attribute DOMString rel;<br> readonly attribute DOMTokenList relList;<br> attribute DOMString media;<br> attribute DOMString hreflang;<br> attribute DOMString type;<br> [PutForwards=value] readonly attribute DOMSettableTokenList sizes;<br> };<br> HTMLLinkElement implements LinkStyle;
link标签用途是设置文档的外部资源。
rel和href属性必须设置,其中href属性必须是一个有效的URL。
其中rel可设置成以下值:
link标签可以建立两种形式的链接,一种是外部资源,另一种是超级连接,例如rel设置成stylesheet是载入外部css样式文档,而设置成first就是意味着告诉浏览器该文档所处系列的第一个文档的超级链接。
一个link标签可以同时设置多个链接(甚至可以包含一些外部资源形式的和一些超级链接形式的),可设置的链接数量取决于link标签的rel属性的设置。
link标签执行过程:
1、如果href值为空,则停止解析此标签。
2、如果资源的URL属性是相对的,则根据相对此文件计算绝对URL值。
3、如果失败,停止解析。
4、根据绝对URL载入资源。

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How do I use viewport meta tags to control page scaling on mobile devices?

How to Add Audio to My HTML5 Website?

How do I handle user location privacy and permissions with the Geolocation API?

How do I use the HTML5 Page Visibility API to detect when a page is visible?

How to Use HTML5 Forms for User Input?

How do I use the HTML5 Notifications API to display desktop notifications?

How to Create Interactive Games with HTML5 and JavaScript?

How do I use the HTML5 WebSockets API for bidirectional communication between client and server?
