I am using Windows (7) trying to create an offline html page that should link to a separate CSS file located in same directory. I tried to use
Use <link rel="stylesheet" type="text/css" href="./styles.css" />
instead. Note: href="/styles.css"
changed to href="./styles.css"
, which is current directory of your script.
A general complete answer:
to address through existing folder, use:
<link rel="stylesheet" href="./style.css">
to address through parent folder, use:
<link rel="stylesheet" href="../style.css">
to address through the internet( CDN ) use:
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3./css/bootstrap-theme.min.css"
>
to address through your hard drive use:
<link rel="stylesheet" href='file:///C:/mystyles.css'>
try this one, it worked for me.
<link rel="stylesheet" href="./main.css">