HTML 5 <link> Tag
Example
Link to an external style sheet:
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head> |
Try it yourself »
|
Definition and Usage
The <link> tag defines the relationship between a document and an external
resource.
The <link> tag is most used to link to style sheets.
Differences Between HTML 4.01 and HTML 5
Some HTML 4.01 attributes are not supported in HTML 5.
The "sizes" attribute is new in HTML 5.
Tips and Notes
Note: The link element is an empty element, it contains attributes only.
Note: This element goes only in the head section, but it can appear any number of times.
Attributes
| Attribute |
Value |
Description |
| href |
URL |
The target URL of the resource |
| hreflang |
language_code |
Defines the base language of the target URL |
| media |
screen
tty
tv
projection
handheld
print
braille
aural
all |
Specifies on what device the document will be displayed
| screen |
For non-paged computer screens |
| tty |
For media using a fixed-pitch character grid (like teletypes, terminals, or devices with limited display
capabilities) |
| tv |
For TV-type devices (low resolution,
limited scrollability) |
| projection |
For projectors |
| handheld |
For handheld devices (small screen, limited
bandwidth) |
| print |
For paged and for documents
viewed on screen in print preview mode |
| braille |
For braille tactile feedback devices |
| aural |
For speech synthesizers |
| all |
For all devices |
|
| rel |
alternate
archives
author
first
help
icon
index
last
license
next
pingback
prefetch
prev
search
stylesheet
sidebar
tag
up |
Specifies the relationship between the current document and
the target URL. Use only if the href attribute is present |
| sizes |
number
any |
Defines sizes of the linked resource. Can be used when rel="icon". |
| type |
MIME_type like:
text/css
text/javascript
image/gif |
Specifies the MIME type of the target URL |
Standard Attributes
| class, contenteditable, contextmenu, dir, draggable, id, irrelevant, lang, ref, registrationmark, tabindex, template, title |
For a full description, go to Standard Attributes in HTML 5.
Event Attributes
| onabort, onbeforeunload, onblur, onchange, onclick,
oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave,
ondragover, ondragstart, ondrop, onerror, onfocus, onkeydown, onkeypress,
onkeyup, onload, onmessage, onmousedown, onmousemove,
onmouseover, onmouseout, onmouseup, onmousewheel, onresize, onscroll, onselect,
onsubmit, onunload |
For a full description, go to Event Attributes in HTML 5.
Create a free Flash website with our simple, online web design editing platform. Stunning templates
and user-friendly tools make website building easy and fun.
Start Creating your free website now!

Need an easy way to get data into XML, or transform XML to another format?
MapForce lets you map XML data to/from any combination of XML, database, flat file,
Excel 2007, XBRL, or Web services data. Then it transforms data instantly or
auto-generates royalty-free code for recurrent conversions.
New features in Version 2010!
- Easy-to-use, graphical data mapping interface
- Instant data transformation
- XSLT 1.0/2.0 and XQuery code generation
- Java, C#, and C++ code generation
- Advanced data processing functions
- Support for all major relational databases including SQL Server, IBM DB2, Oracle, and more
- Visual Studio & Eclipse integration
- Available in 32-bit and 64-bit versions
Download a fully-functional trial today!
|
|
|
|