+ 1
How to link css to html in a webhost?
My code of both html and css worked together here. but when I upload these codes into a webhost css is not working.only html code is getting loaded. I have tried using link tag . but in vain
1 Respuesta
+ 4
CSS -> Module 1: The Basics -> Lesson 2 -> External CSS
<link rel="stylesheet" href="example.css">
Note the your href needs to include the relative path to your css file.
If your file/folder structure was:
index.html // file
CSS // Directory
with styles.css inside the CSS folder your link would look something like:
<link rel="stylesheet" href="./CSS/styles.css">
or
<link rel="stylesheet" href="CSS/styles.css">
If you had a file/folder structure like:
HTML //Directory
CSS //Directory
with index.html in the HTML folder and styles.css in the CSS folder your link would look something like:
<link rel="stylesheet" href="./../CSS/styles.css">
or
<link rel="stylesheet" href="../CSS/styles.css">
Where ./ refers to the current directory and ../ navigates up one parent directory.