Linking CSS File with HTML Document In Different Directories On my Windows
You should go back one directory back by ../
. This way go to parent folder of these two files. Then start to go into css file's directory.
href="../styles/style1.css"
Link CSS from another folder?
If your current folder is /current/folder/location/index.html
, and your .css
file is in /current/second/folder/style.css
, then use this as an example:
<link rel="stylesheet" type="text/css" href="../../second/folder/style.css">
or alternatively:
<link rel="stylesheet" type="text/css" href="/current/second/folder/style.css">
However, if the second file is in `/current/folder/second/style.css, then use:
<link rel="stylesheet" type="text/css" href="../second/style.css">
Related Topics
CSS Nth-Child Apply Odd-Even Rule But Switch Every 4 Items
How to Create Curved Line with Rounded Edges
Use Calc() Function in Makestyles
Two Divs Next to Each Other, That Then Stack with Responsive Change
Allow a Div to Cover the Whole Page Instead of the Area Within the Container
Bootstrap 3:Vertically Center Navigation Links When Logo Increasing the Height of Navbar
CSS 62.5% Why Do Developers Use It
How to Position Background Image in Bottom Right Corner? (Css)
Make a Grid Column Span the Entire Row
Select All Elements After Specific Element
Vertical Space Created from Float
Unordered List That Acts Like Grid-Auto-Flow Dense
Difference Between Justify-Content VS Align-Items
Scroll Inside of a Fixed Sidebar
How to Properly Introduce a Light/Dark Mode in Bootstrap