Linking HTML and CSS that are in different folders
It looks like this is what you need:
SITE
|
+--- HTML
| |
| +--- index.html
+--- CSS
|
+--- main.css
<link rel="stylesheet" type="text/css" href="../CSS/main.css">
First you navigate out of your current folder ("..") and then into your CSS folder.
How do I link files from different folders in HTML?
Using ../
allows you to jump back a directory (folder) and ../../
would jump back two directories. If your at the root directory you can access a file with /index.html
. Have a look at the Dealing with files - MDN documentation for more detailed information.
Related Topics
Embed Youtube Video - Refused to Display in a Frame Because It Set 'X-Frame-Options' to 'Sameorigin'
Bug with Firefox - Disabled Attribute of Input Not Resetting When Refreshing
Image Width/Height as an Attribute or in CSS
How to Isolate a Div from Public CSS Styles
HTML Combo Box with Option to Type an Entry
Mailto Link Multiple Body Lines
Turn Off Chrome/Safari Spell Checking by HTML/Css
Do Http Post Methods Send Data as a Querystring
HTML Favicon.Ico Won't Show on Google Chrome
Why Are My Div Margins Overlapping and How to Fix It
How to Flip Images Horizontally with HTML5
Why Use Schema.Org Microdata to Mark Up Web Page Elements
Bootstrap Navbar. When I Press the Button Nothing Happens
Why Is There Space Between Line Boxes, Not Due to Half Leading
Why Are Some of My CSS Rules Not Working
Equalize the Height of Left and Right Div, Prevent Right Div from Going Below Left Div