This is my path for my HTML file: C:\Users\Lorenzo\Desktop\Capstone Project\HTML\index.html
and this is my path for my CSS file: C:\Users\Lorenzo\Desktop\Capstone Project\CSS\style.css
This is my path for my HTML file: C:\Users\Lorenzo\Desktop\Capstone Project\HTML\index.html
and this is my path for my CSS file: C:\Users\Lorenzo\Desktop\Capstone Project\CSS\style.css
Add
<link rel="stylesheet" type="text/css" href="../CSS/style.css">
// or
<link rel="stylesheet" type="text/css" href="..\\CSS\\style.css">
to your index.html
file
Notice: If you're using Live Server
on VSCode (like me). You have to open VSCode with the folder Capstone Project\
, not HTML\
, or you'll run into an error
Refused to apply style from 'http://localhost:3000/CSS/style.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
That error has been discussed here
link your CSS on head part of HTML file
<html>
<head>
<title>Page Title</title>
<!-- link your style.css file -->
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<!-- your HTML page body -->
</body>
</html>