+ 1

my code "css" doesn't work

my code html <!DOCTYPE HTML> <html> <head> <link rel="stylesheet" href="/css/basic3.css"> </head> <body> <p>este es un elemento .css</p> <ul> <li><a href="https://www.w3schools.com" target=".blank">w3schools</a></li> <li><a href="https://www.sololearn.com" target=".blank">sololearn</a></li> <li><a href="https://www.codeacademy.com" target=".blank">codeAcademy</a></li> </ul> <p class="fantasy">FontFamily</p> </body> </html> Doesn't work with the file css p{ color:#ff0983; background-color: blueviolet; } .fantasy{ font-family: fantasy; } can you give me a solution?

8th Oct 2020, 7:00 PM
Bayron Urbina
Bayron Urbina - avatar
18 Answers
+ 1
Copy full path from address bar.. by opening file. May be it is in like this form : "c://users/User/Desktop/css/basic3.css" No extra spaces. No typos.. Edit : but local mobile path works only for you, not for others.. And also may be in laptop only.. I doubt in mobile.. Bayron Urbina
10th Oct 2020, 2:22 PM
Jayakrishna 🇮🇳
+ 6
What do you mean by carpet? please show us the link of where you got the CSS external file Also tell us exactly what you are getting and what you are trying to achieve
8th Oct 2020, 7:21 PM
Galaxy-Coding (inactive)
Galaxy-Coding (inactive) - avatar
+ 3
By "carpet" you mean folder? directory?
8th Oct 2020, 7:53 PM
Shadoff
Shadoff - avatar
+ 3
Are you trying this on code playground?
9th Oct 2020, 1:10 AM
Sonic
Sonic - avatar
+ 3
On code playground you don't link your style sheet with link tag.
9th Oct 2020, 1:19 AM
Sonic
Sonic - avatar
+ 2
Ok, it suppose to be p.fantasy
8th Oct 2020, 7:12 PM
Nwanebike Daniel
Nwanebike Daniel - avatar
+ 2
Sonic yes, but in my computer it doesn't work
9th Oct 2020, 1:17 AM
Bayron Urbina
Bayron Urbina - avatar
+ 2
In the first a tag in target=Blank is error You should use underscore before blank i.e. target='_blank'
9th Oct 2020, 6:04 AM
Harshit Dugar
Harshit Dugar - avatar
+ 2
Bayron Urbina you have to use full URLs in link and script tags in Sololearn not relataive URLs
9th Oct 2020, 6:28 AM
Arnav Kumar [Less/Not Active]
Arnav Kumar [Less/Not Active] - avatar
0
It's working fine.. May be you are not linking css file to html correctly.. Make sure the path is correct.. Check here in playground once..
8th Oct 2020, 7:07 PM
Jayakrishna 🇮🇳
0
@Jayakrishna🇮🇳 But a put the css file in another folder, in the new folder doesn't work but in the same folder that is the html file it works. I wanna know how to make them work in diferent folders
8th Oct 2020, 7:11 PM
Bayron Urbina
Bayron Urbina - avatar
0
Try to add a style Tag directly in your head and add the css there if it still won't work its your Css you have to work on. Do you want to change all paragraphs or only the ones within your fantasy class. In that case you have to define the css as .fantasy p{}
10th Oct 2020, 7:51 AM
jack
jack - avatar
0
Bayron Urbina <link rel="stylesheet" href="/css/basic3.css"> Here, refference is not the full link.. /css/ means search in current folder about css folder... So if file is in any other folder, then mention full path..
10th Oct 2020, 1:25 PM
Jayakrishna 🇮🇳
0
Jayakrishna🇮🇳 hmmmmm, how should I mention the full path? I've tried with href ="c: users/User/Desktop/css/basic3.css/ but it won't work
10th Oct 2020, 1:33 PM
Bayron Urbina
Bayron Urbina - avatar
0
Bayron Urbina Regarding the folder path. /folder/filename should be enough, given the file is in a subfolder of your application(which it should be) If you use the whole pathname on your machine you wont be able to access the file from another machine because the path obviously won't exist.
10th Oct 2020, 3:52 PM
jack
jack - avatar
0
Jayakrishna🇮🇳 It works now, tank you bro
10th Oct 2020, 6:09 PM
Bayron Urbina
Bayron Urbina - avatar
- 1
Я из росии
10th Oct 2020, 1:32 PM
Maxil
- 2
Gowno
9th Oct 2020, 2:31 PM
Maxil