vadnica-logo
X

The <link> tag

The <link> tag defines the relationship between the current HTML document and an external resource. It is most commonly used to include external stylesheets (CSS) or to add a website icon (favicon). The <link> element is an empty element, meaning it only contains attributes and has no closing tag. In the PHPStorm IDE, you create an external style by right-clicking the project and selecting New > Stylesheet, choosing the css type, and naming the file (e.g., zunanji.css). You then insert the file into the head (<head>) of the HTML document:

<link rel="stylesheet" href="style.css">    
EXAMPLE
RESULT

The table below shows the attributes that can be used with the <link> element to more precisely define the connection, specify the target device (media), manage security policies, or specify the language and type of the resource.

crossorigin Specifies how the element handles cross-origin requests. See Example
href Specifies the location of the linked document. See Example
hreflang Specifies the language of the text in the linked document. See Example
media Specifies on which device the linked document will be displayed. See Example
referrerpolicy Specifies which referrer to use when fetching the resource. See Example
rel Required. Specifies the relationship between the current document and the linked document. See Example
sizes Specifies the size of the linked resource. Only for rel="icon". See Example
title Specifies a preferred or alternate stylesheet. See Example
type Specifies the media type of the linked document. See Example

Thank you for visiting! Adding privacy policy.

© 2024 All rights reserved.

Vam je koda pomagala? Če želite podpreti moj trud pri pripravi vodičev in vzdrževanju strani, mi lahko namenite donacijo za kavo.