+ 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?
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
+ 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
+ 3
By "carpet" you mean folder? directory?
+ 3
Are you trying this on code playground?
+ 3
On code playground you don't link your style sheet with link tag.
+ 2
Ok, it suppose to be p.fantasy
+ 2
Sonic yes, but in my computer it doesn't work
+ 2
In the first a tag in target=Blank is error
You should use underscore before blank i.e. target='_blank'
+ 2
Bayron Urbina you have to use full URLs in link and script tags in Sololearn not relataive URLs
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..
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
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{}
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..
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
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.
0
Jayakrishna🇮🇳 It works now, tank you bro
- 1
Я из росии
- 2
Gowno