0
The code doesn’t work on PC
Pls, help, the code doesn’t work on PC https://code.sololearn.com/WflejzbDwRDJ/?ref=app
16 Respostas
+ 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
+ 6
See the difference
https://code.sololearn.com/W9mzsmiisTb9/?ref=app
+ 4
background-color:gray;
+ 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”?
+ 1
Матвей Барканов dont forget to correct css file, you have wrong syntax there
+ 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:
+ 1
closing tag of link
0
But all correct…
0
Omg I cant’t see the difference
0
So your css is "intro.css" your path is then just href="intro.css"
0
Ok, I correct href=“intro.css”, but it doesn’t work again
0
I closed “link”
0
What isn’t correct?
0
I can't see the code on here man
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;
}
0
Bracket sequence again please help cpp