Noah B.
Noah B.

Reputation: 21

CSS does not exist?

I am trying to make a website, and my css seems not to exist, no error, no style, nothing. This is what I have got:

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

This is the path:

index.html /css --> style.css

I went to the console to search after any error, there is no error, none. In fact, I went to the sources, and it is not even there.

Please, I would like to get feedback, thank you.

Upvotes: 2

Views: 557

Answers (3)

Kalin Patel
Kalin Patel

Reputation: 531

Set the type to "text/css". Also, try not to use a / at the beginning of your file paths if you can.

You can use this line instead.

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

Upvotes: 0

deep206
deep206

Reputation: 104

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

This should do it, or you can also replace your type="type/css" to type="text/css"

type="type/css" is not the correct link type.

Upvotes: 2

technophyle
technophyle

Reputation: 9118

You should be careful of using / prefix in the paths.

Also, there's no link type called type/css. It's text/css.

Both of these will work:

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

Upvotes: 2

Related Questions