asp.net.ph

Skip Navigation LinksHome > Abakada: Back to Basics > Language References > HTML Elements > LINK Element

LINK Element | LINK Object


Enables the current document to link to external files.HTML 2, 3.2, 4, 4.01, 5

HTML Syntax

Remarks

This element can be used only within the HEAD tag.

NOTE: Only the <link> start tag must be present. The element has no end tag.

Attributes

The <link> element supports the following attributes, in addition to global attributes common to all HTML elements.

AttributeValueDescription
crossoriginanonymous, use-credentialsSpecifies how the element handles cross-origin requests
hrefURLSpecifies the location of the linked document
hreflanglanguage_codeSpecifies the language of the text in the linked document
mediamedia_querySpecifies on what device the linked document will be displayed
referrerpolicyno-referrer, no-referrer-when-downgrade, origin, origin-when-cross-origin, unsafe-urlSpecifies which referrer to use when fetching the resource
relalternate, author, dns-prefetch, help, icon, license, next, pingback, preconnect, prefetch, preload, prerender, prev, search, stylesheetRequired. Specifies the relationship between the current document and the linked document
sizesHeightxWidth, anySpecifies the size of the linked resource. Only for rel="icon"
title Defines a preferred or an alternate stylesheet
typemedia_typeSpecifies the media type of the linked document

Example

This example shows how to link to an external style sheet. The styles defined in that file are applied to the page.

<link rel="stylesheet" type="text/css" src="styles.css">
See Also

Linking Style Sheets



Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note