+ 2
How do I group html, css, and js files in folder on a pc desktop so that a browser executes css and js files with html doc?
How do I group html, css, and js files in folder on a pc desktop so that a browser executes css and js files with html doc? I have document file html saved as .html, css as .css, and javascript as .js. All three files are in a folder and files/folder all have same title "demo2." When I access .html file with browser such as Google Chrome the only output I see is the .html without effective .css and/or .js files. How do I combine folder files so browser opens them together as a webpage?
15 Answers
+ 6
Oh well, I will now explain step by step on how to do it. First do not use notepad, becuase notepad++ is superiour in any way.
Okay first create a folder named 'site'. Inside create 3 files. "index.html", "style.css", "script.js". Now go inside of your index.html and code should look like this:
<!DOCTYPE html>
<html>
<head>
<title>title</title>
<link rel='stylesheet' href='style.css' />
</head>
<body>
<!-Your html
code will go
here-->
<script type='text/javascript' src='script.js'></script>
</body>
</html>
Now the only thing you need to do is run index.html and the whole thing will be connected
+ 5
create a folder
add three files in same folder (html,css,js)
example-> page.html , style.css, page.js
In html inside head add link and script tags and specify paths
open html file in browser
+ 3
@Ice , Yesssssssssssssss!!!
Thank You Ice!
+ 2
@WASP
+ 2
@Swapnil Srivastava
+ 2
I know the excitement here is for mobile applications but I would like to try platform conversion for experimental learning.
+ 2
Thx @Ice and @code learner !
I'm still working on it... not clear on the specifics of the code I'm working on yet but I'm grateful for your help!
+ 2
I initially tried transposing code from html, css, and js files from working code in Sololearn however using Windows 8, Notepad, Google Chrome, and file Explorer the files were not initially coming together but I'm working on it! I've tried several different approaches but it is still not clear to me.
+ 2
I'm trying to simply transpose functioning code as it operates via Sololearn app so that it operates via web browser on PC platform without actually needing to connect to an external server. I want the webbrowser to output operational code from a folder on my desktop as it outputs the same operational code using the Sololearn App.
+ 2
I want to write and test code with web browser offline.
+ 2
Glad that I helped, good luck with your site! Have fun!
+ 2
#FullyOperational
+ 1
just as @code learner said.
For CSS in head tag put <link rel="stylesheet" href="style.css" />
For JS put the tag near the end of the body
<script type="text/javascript" src="script.js"></script>
+ 1
I just made a variation on Sololearn Quiz Code public via my account here.... perhaps you all can help me fill in the blanks. I tried using simply file name extensions without full filepath as location reference and also tried using full filepath as location reference still it is not operational.
+ 1
Explain everything. Do you want to create a site from your desktop, or you want to create one via sololearn's code playground?