Css is not linking to html

html-css

#1

Hello everyone,

I have been trying to link my css file to my html file but they just won’t link.

<html>
<head>
    <title> first website </title>
  <link rel="stylesheet" type="text/css" href="main.css">
</head>
<body>
   <h1> Test</h1>
   <p> hello
   </p>
</body>
</html>


both my css and html are in the same folder

first time trying, so not sure what I am doing wrong…


#2

Hi Lora,

Please read this post to learn how to properly format code in posts on the forum.

Has an extra < should be <html>

This code looks fine, you said its in the same folder so it should work.

At the end of the file should be closing html tag which looks like this: </html>

Please make the above changes, save it and if the CSS is still not working, paste in the updated HTML code as well as your CSS code and a screenshot of what the result looks like


#3

the < and /> are not actually in the code but where accidentally added when I posted the message. Code looked fine to me too thats why I am a bit confused


#4

anything ?

Any progress ?

If not post in your HTML & CSS code as well as a screenshot of the results in a browser


#5

still not sure where I went wrong. But am now working on brackets instead of atom and its working :slight_smile: Thanks for the help!


#6

A post was split to a new topic: Css not linking to html


#7

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