- 1

Css and Js links in HTML

How do I refer to my css and JavaScript files in the editor? (So what is the file called?)

3rd Nov 2016, 4:32 PM
Mekode
4 odpowiedzi
0
Add link ref tags inside your html header like this: For your CSS files: <link rel="stylesheet" type="text/css" href="/css/example.css" /> For your JS files: <script type="text/javascript" src="/js/example.js"></script> Change the "/css/" and "/js/" parts for any folder where your files are located in.
3rd Nov 2016, 4:52 PM
Hanike T.
Hanike T. - avatar
0
Instead of under-voting someone who's trying to help you, you should be more specific in your questions.
7th Nov 2016, 6:26 PM
Hanike T.
Hanike T. - avatar
- 1
If you talking about sololern's editor, than you should just add your styles and js into css and js tabs. If you talking about your local files, than you should do like this: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Template</title> <link href="css/styles.css" rel="stylesheet"> </head> <body> <h1>Hello, world!</h1> <script src="js/scripts.js"></script> </body> </html> where css and js folders in the same directory where your html is.
3rd Nov 2016, 4:46 PM
Ал К
Ал К - avatar
- 2
yea I was talking about the sololearn editor. I knew how to do it in local files but not in here. thank you!
3rd Nov 2016, 4:57 PM
Mekode