Cannot link stylesheet :-( :-(

Cannot link stylesheet :-( :-(
0

#1

i have been on several forums from people with the same problem but it appears as though i haven’t done anything wrong and it should work fine. it was copied from my course material so i cant see why it wouldn’t work.
below is index.html

<!DOCTYPE html>
<html>
<head>
	<link rel="stylesheet" type=“text/css" media=“screen” href=“style.css">
	<title>Classical Ciphers</title>
</head>
<body>
	<h1> hello world </h1>
</body>
</html>

and below is style.css (just to test)

body {background-color:black}
h1 {color:red}
p {color:blue}

both files are in the same folder but the stylesheet is ignored whenever i test the html page. i have cleared and re cleared the cache and used both IE and Chrome. am i missing something terribly obvious here? i just want to get them working together then i can start messing around and learning how it all works properly. I have coursework due! thanks in advance for any advice


#2

I’ve edited your post for readability. When you enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

You have some curly double quotes “ and ” which need to be straight double quotes " in the following line of your HTML.

<link rel="stylesheet" type=“text/css" media=“screen” href=“style.css">

#3

So it was simple. Thanks a lot for your rapid and helpful reply!


#4

You can use straight double or single quotes when surrounding an element attribute’s value, but they both need to be the same kind.

Correct:

<h1 style="color: red;">Hello</h1>

<h2 style='color: green;'>World</h2>

Incorrect:

<h3 style='color: blue;">Hello World</h3>