0

The code doesn’t work on PC

Pls, help, the code doesn’t work on PC https://code.sololearn.com/WflejzbDwRDJ/?ref=app

10th Mar 2022, 8:50 AM
Матвей Барканов
Матвей Барканов - avatar
16 Answers
+ 8
Матвей Барканов you forgot to close link tag <link rel="stylesheet" href="D:\example.css"></link> Also your relative path is wrong, you dont need D:\ thats why it dont work on pc Here is more about relative path, i tried to explain few most used cases https://css-tricks.com/quick-reminder-about-file-paths/ If your css is in same folder as html, just use "example.css" as path If it is in folder like cssFolder example.css index.html Your path is "cssFolder/example.css" -- note we use "/" not "\" But if you have structure like this projectFolder documentFolder index.html cssFolder example.css Where each file(html and css) are in diferent folder your path is "../cssFolder/example.css" with ".." We exit from current folder, your html is in documentFolder, you look back one folder with ".." So we now look in projectFolder, we can access from here to cssFolder and in cssFolder to our style example.css
10th Mar 2022, 9:47 AM
PanicS
PanicS - avatar
10th Mar 2022, 8:55 AM
Simba
Simba - avatar
+ 4
background-color:gray;
10th Mar 2022, 8:52 AM
Simba
Simba - avatar
+ 1
So, on my computer I have the folder on D disc, the folder name is “WebDev”, in this folder I have two files that are : intro.css example.html So, what I need to write in “href”?
10th Mar 2022, 9:56 AM
Матвей Барканов
Матвей Барканов - avatar
+ 1
Матвей Барканов dont forget to correct css file, you have wrong syntax there
10th Mar 2022, 10:13 AM
PanicS
PanicS - avatar
+ 1
Also your div with id css wont show even here on sololearn, because of wrong css syntax. To fix on sololearn correct css syntax, to fix on pc close link tag and use right relative path to your css, and also correct css syntax. It is as Simba said background-color: gray; Not background-color gray:
10th Mar 2022, 10:17 AM
PanicS
PanicS - avatar
+ 1
closing tag of link
11th Mar 2022, 3:04 PM
Arjit Tiwari
0
But all correct…
10th Mar 2022, 8:53 AM
Матвей Барканов
Матвей Барканов - avatar
0
Omg I cant’t see the difference
10th Mar 2022, 8:59 AM
Матвей Барканов
Матвей Барканов - avatar
0
So your css is "intro.css" your path is then just href="intro.css"
10th Mar 2022, 10:01 AM
PanicS
PanicS - avatar
0
Ok, I correct href=“intro.css”, but it doesn’t work again
10th Mar 2022, 10:02 AM
Матвей Барканов
Матвей Барканов - avatar
0
I closed “link”
10th Mar 2022, 10:02 AM
Матвей Барканов
Матвей Барканов - avatar
0
What isn’t correct?
10th Mar 2022, 10:13 AM
Матвей Барканов
Матвей Барканов - avatar
0
I can't see the code on here man
10th Mar 2022, 3:48 PM
Taiwo Asiyanbi
Taiwo Asiyanbi - avatar
0
Матвей Барканов like Simba pointed out: your colon is in the wrong place and you placed it in place of your missing semicolon. #css { color: white; background-color gray: --> wrong } should be #css { color: white; background-color: gray; }
11th Mar 2022, 4:20 AM
Bob_Li
Bob_Li - avatar
0
Bracket sequence again please help cpp
11th Mar 2022, 4:06 PM
Abedalqader Mohammed Abujaffer
Abedalqader Mohammed Abujaffer - avatar