Home > Net >  Why is my stylesheet not linking? I have linked it correctly
Why is my stylesheet not linking? I have linked it correctly

Time:07-16

I can't see a reason why it is not linked.

The html file content

<!doctype HTML>
<html lang="en">
<head>
    

    <meta charset="utf-8">
    
   
    <title>site</title>
    <link href="code_styles.css" rel="stylesheet" />

</head>
</html>

the css file content

@charset "utf-8";
body{
            background-color: aquamarine;
        }

enter image description here

CodePudding user response:

Check if the your CSS file is in the same directory as the HTML file. If no, then link it properly

CodePudding user response:

you need to add a ./


    <link href="./code_styles.css" rel="stylesheet" />
  • Related