Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære External CSS | Getting Started with CSS
CSS Foundations

bookExternal CSS

index.html

index.html

style.css

style.css

copy

You use the <link> tag in the <head> section of your HTML document to connect an external CSS file. The most important attributes for this tag are rel and href. The rel attribute describes the relationship between the HTML and the linked file, and should be set to "stylesheet" for CSS files. The href attribute specifies the path to your CSS file. Linking an external stylesheet allows you to keep your CSS rules in a separate file, making your HTML cleaner and your styles easier to maintain or reuse across multiple pages.

question mark

Which HTML tag is used to link an external CSS file to your HTML document?

Select the correct answer

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. Kapitel 3

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

Suggested prompts:

Can you show me an example of how to use the `<link>` tag in HTML?

What are some common mistakes to avoid when linking a CSS file?

How do I link multiple CSS files to one HTML document?

Awesome!

Completion rate improved to 6.67

bookExternal CSS

Stryg for at vise menuen

index.html

index.html

style.css

style.css

copy

You use the <link> tag in the <head> section of your HTML document to connect an external CSS file. The most important attributes for this tag are rel and href. The rel attribute describes the relationship between the HTML and the linked file, and should be set to "stylesheet" for CSS files. The href attribute specifies the path to your CSS file. Linking an external stylesheet allows you to keep your CSS rules in a separate file, making your HTML cleaner and your styles easier to maintain or reuse across multiple pages.

question mark

Which HTML tag is used to link an external CSS file to your HTML document?

Select the correct answer

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. Kapitel 3
some-alt