W3Schools.com

HTML <link> href Attribute

HTML link Tag Reference HTML <link> tag

Example

Link to an external stylesheet:

<link rel="stylesheet" type="text/css" href="theme.css" />

Try it yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The href attribute is supported in all major browsers.


Definition and Usage

The href attribute specifies the location (URL) of the external resource (most often a style sheet file).


Syntax

<link href="URL" />

Attribute Values

Value Description
URL The URL of the linked document.

Possible values:

  • An absolute URL - points to another web site (like href="http://www.example.com/theme.css")
  • A relative URL - points to a file within a web site (like href="/themes/theme.css")


HTML link Tag Reference HTML <link> tag
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE