Ask coding questions

← Back to all posts
why is my css not linking with my html
Fadrep (1)

I need help linking my html with the css.
What can i use to make my tables to be in line and also in the center of the page.



your css file is named style.css. But you are linking styles.css. So try linking the correct thing.

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

like that.
That should work

tussiez (1669)

@Fadrep, it appears you've made a typo on line 5 of index.html. Instead of referencing style.css, you typed styles.css. If you change it to the correct filename, you should be good to go!
No biggie, just a typo :)

EpicGamer007 (1736)

the css file is called style.css, not styles.css. change the <link href="styles.css" rel="stylesheet" type="text/css"/> on line 5 to <link href="style.css" rel="stylesheet"/>

19wintersp (1142)

You've simply misspelled the filename; the href specified in the <link> tag needs to match the name of your file:

<link href="styles.css" rel="stylesheet" type="text/css"/> <!-- wrong -->
<link href="style.css" rel="stylesheet" type="text/css"/> <!-- good -->
19wintersp (1142)

@EpicGamer007 You don't, but I have no need to change that code. It works, I don't need to meddle with it. I will change what needs to be changed, and no more. The principle of least impact applies here. If I have no need to touch it, I shall leave it.