External Css stylesheet not linked to my HTML

86 views Asked by At

My External css file is not linked to my html page. I had with inside a folder with path

->app-->css-->layout.css
->index.html

In my index.html file I linked it like <link rel="stylesheet" type="type/css" href="app/css/layout.css"> it won't link it. i searched for the file in the chrome (inspect-->sources) and the css file wasn't listed there

I then put the layout.css and index.html in the same path. <link rel="stylesheet" type="type/css" href="layout.css">

it still didn't work. I checked in multiple browser like chrome and firefox as well but it didn't work.

3

There are 3 answers

1
Om_16 On BEST ANSWER

You can directly use the command below to get the desired result

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

Its a very common mistake that everyone do... Please notice that here type="text/css" not type/css...

Regards,
Om Chaudhary

1
lanxion On

Not sure if it is causing the error(most probably is), but type should be text/css instead of type/css.

0
Darshan Unadkat On

Just replace the type/css to text/css and there is no need to write full path name in href.