Linking html and css files only works with copy/paste!


<Below this line, add a link to the EXACT exercise that you are stuck at.>

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>

basically i’m trying to link my .css file to my .html file and open the .html file in safari. the .html file just has a h1 header and the .css file is just supposed to turn h1 red. very simple stuff. when i name the .css file topside.css for example, and use this name in the link command, nothing happens (the h1 header remains black). when i rename the .css file main.css (which the codecamedy exercise uses as the .css file name) and copy and paste the link command from the codecademy exercise, it works (h1 turns red). however, if i delete “main” and simply type it again, it stops working (remains black). it’s as if something is different about the pasted characters and it’s breaking the link when i retype or type my own name. i’m completely stumped. i’m doing all my code in textedit and like i said i’m trying to open it in safari (but i tried and the same thing happens in firefox so it’s not the browser). also, both the .html file and the .css file are in a folder on my desktop.

<link rel="stylesheet" type="text/css" href="main.css"> (pasted version, works)
<link rel="stylesheet" type="text/css" href=“main.css"> (typed version, doesn't work) 

Take a look here:


Problem is in the . You should change it to ".

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.