FAQ: Learn CSS Selectors Visual Rules - CSS Setup Selectors - Linking the CSS File

I could speculate, but seeing code samples would make matters a whole lot easier

I have attempt to link css to html, but nothing seem to change, i even change font-size to something big, but size remaining same. I try this on my personal html and on this exercise. nothing changed. But the style attribute work fine, so I did something work with my Linking.

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

p {
font-family: Arial;
font-size: 50px;
}

Please understand that exercise said that I did it correctly, but I do not see any change at all.

the <head></head> is a section where you can put information relevant for you as a programmer (link to stylesheet, title, meta data and so forth)

so then you get:

<head>
   <link><!-- with all the attributes (href, type and rel) -->
</head>

<link> is an element on its own.

Oh my god, it works, thank for your advice! for some reason, the exercise sees this element within the header as correct.

Hello, so ive followed the exercise and it got the checkmark but nothing changed in the paragraph. what am i doing wrong?

link href=“style.css” type=“text/css” rel=“stylesheet” (inside the head element)

  p {

    font-family: Arial;

  }

they are inside <> but if i copy it like this here nothing shows up

EDIT: I figured it out, in the style.css file you cant have the code inside < style > tags. This information is not really clear in the lesson although it seems kinda obvious, maybe add something about this in the lesson?

1 Like

Hello!
When i add this line:

It wont’t make the text go Ariel font;

But when I type ./style.css instead of URL above, it does work.

What is the problem?

Thank you!

I find the instruction very vague and unhelpful. I ask for solution and go back and I honestly have no clue how I am supposed to understand what I can’t see Why don’t you highlight the lesson so one can see where they are supposed to look? This is so frustrating

Thank you! Had this exact same problem.

Considering we have to add the type beyond the rel attribute, are there other stylesheet types?

Is type="text/css" really needed?
I tried my code without it and it worked anyways.

For backward compatibility, yes. Going forward, no. It’s all a matter of how much of the past do we wish to cling to.

Why was it needed before?

We’d need to do some digging in the old specifications to get a good answer to that question. It was there to tell the user agent which API to use to parse the file. Newer browsers are able to read the file header to parse out the MIME Type.

Thanks!

P.S.

I see your answers all over and they’re always helpful. Thank you!

1 Like

after linking my HTML and CSS files, I didn’t notice any change in the font in the first paragrapmy code