-1

I don't know why my html is not being formatted by my CSS. I made sure the name of my CSS file is the same as the one in the HTML file. There are also no errors in my CSS file, it has been validated. It's the same format as other projects I've done, same folder and everything, but for some reason it isn't working.

<head>
    <meta charset="utf-8">
    <title>Project 5: Javascript Arrays</title>
    <link rel="stylesheet" href="project5.css">
    <script src="project5.js"></script>
    
</head>
Sam Dixon
  • 3
  • 2

2 Answers2

0

Make sure both files in the same folder and this code should work

<link rel="stylesheet" href="./project5.css">
Ali Jalal
  • 26
  • 3
0

This might happen if your css file is in another directory. If your project looks like this:

index.html

css/project5.css

You would need to use href="css/project5.css". Please make sure the filepaths are correct.

R. De Caluwe
  • 427
  • 1
  • 4
  • 13