2

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.

double-beep
  • 5,031
  • 17
  • 33
  • 41
Noah B.
  • 21
  • 2
  • Related, but maybe not a duplicate: https://stackoverflow.com/questions/2718532/is-a-relative-path-in-a-css-file-relative-to-the-css-file – computercarguy Dec 04 '20 at 22:12

3 Answers3

2

<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.

deep206
  • 106
  • 2
  • 10
1

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"/>
technophyle
  • 7,972
  • 6
  • 29
  • 50
0

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"/>
Kalin Patel
  • 501
  • 3
  • 5