How to link css to html in a webhost? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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

31st Aug 2017, 8:17 AM
panyam kaivalya
panyam kaivalya - avatar
1 Answer
+ 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.
31st Aug 2017, 9:09 AM
ChaoticDawg
ChaoticDawg - avatar