- 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?)
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.
0
Instead of under-voting someone who's trying to help you, you should be more specific in your questions.
- 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.
- 2
yea I was talking about the sololearn editor. I knew how to do it in local files but not in here. thank you!