+ 1
What is the best way to use sololearn web codes when offline?
The point is to copy html, css and js code into three text files respectively in to some local folder and then use browser to view them. What basically need to be done to achieve this? Any best practices?
2 odpowiedzi
+ 2
All three files should be in three different directories(folders) as follows
HTML files should be in your project name directory e.g facebook-project.
CSS files should be a sub directory named css under your project name.
JavaScript files should also be a sub directory named js under your project name.
then to reference them, your code should be as follows in head head tag of your index.html file.
<link rel="stylesheet" type="text/css" href="css/style.css">
<script type="text/javascript" src="js/script.js"></script>
0
I've just added the folowing to the bottom of the head section of main html file (filenames are "index.html", "style.css" and "script.js", respectively:
<script src="script.js"></script>
<link rel=stylesheet type="text/css" href="style.css">
It works just fine, but I wonder if there is a better way to achieve same goal?