Error when linking CSS stylesheet into HTML file


#1

I wanted to start testing what I have been learning and create something. I am having a problem with the link. It doesn't work. I am doing this on Notepad and all on my computer. I saved both CSS and HTML files in the same folder on my desktop. They both were saved with .CSS and .HTML respectively.

<!DOCTYPE html>
<html>

<head>
    <title>My thrift finds</title>
    <link rel="stylesheet" type="text/css" href="style.css"/>
</head>

<body>

I keep getting a message that says ERROR link was not found. What am I doing wrong?. I ran a short simple test with a small HTML and CSS files and it worked.


#2

what is the name of your css file? Are the html and css file in the same directory?


#3

Yes, they are saved in the same folder. The name of my css file is: style.css


#4

Nothing wrong with the code.

You said you ran a test and it worked. What did you do differently?


#5

I forgot to mention that the short test I ran was on another computer. I don't know why it doesn't work on mine.


#6

That's... odd.

Try putting both files on your desktop, just to check?


#7

Nope. it didn't work. I had them on a folder saved on my desktop. I took them out of the folder and just had them directly on my desktop but it didn't work.
It is very odd.


#8

And this is what my CSS stylesheet looks like when I open it, nothing crazy:

h1 {
text-align: center;
}

p {
font-family: 'Muli', 'sans-serif';
}


#9

This is very odd. I hope someday someone can tell me why this happens. I just ran another test on another computer and it worked. I guess I have to work on another computer because mine is taking me nowhere.


#10

Out of curiosity, what kind of computer do you have? What's the OS?
I've never seen such problem before.


#11

nice post, I was searching this code, thanks