narypigeon
narypigeon

Reputation: 113

My stylesheet isn't working/being linked properly

My stylesheet isn't being linked on my webpage. I've got the code below in the <head> section of my HTML page. To better clarify, stylesheet.css is located in the same directory/path as my index.html.

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

I expected it to correctly link my stylesheet but nothing is happening.

EDIT: Fixed it by removing the "."s before my function calls in my stylesheet. Thank you all for your help!

Link to my project

Upvotes: 0

Views: 59

Answers (3)

לבני מלכה
לבני מלכה

Reputation: 16261

You issue is about selector in css and not about file load

As I see in F12 your file load:

enter image description here

But you don't have any class="button" as you have in css

So add class to button as class="button"

enter image description here

See working example

Edit! Thanks to @Thomas Scheffer comment:

Remove also the . before body in css (you use .body)

Upvotes: 1

Giovanni Rizza
Giovanni Rizza

Reputation: 49

Often it could be a browser problem.

Try refreshing the page deleting cache files, in Chrome you can do that by pressing CTRL + F5.

If you're running a Linux based system, make sure that all the interested files have sufficient permissions to do so.

Upvotes: 0

Ambroży
Ambroży

Reputation: 75

Open your html file in e.g. Chrome and press F12. If you link your css with bad path you will see on console error, something like this: GET file:///......./stylesheet.css net::ERR_FILE_NOT_FOUND

Upvotes: 0

Related Questions