+ 1
Notepad++ users
how do i combine my html js and css files together cus mine are seperated in 1 file
2 Answers
+ 12
To put your HTML, CSS and JavaScript in one file you either make a normal HTML file and add your CSS and JavaScript into the <style> and <script> tags respectively:
<!DOCTYPE HTML>
<html>
<head>
<style>
// Your CSS goes in here
</style>
</head>
<body>
<script>
// Your JavaScript goes in here
</script>
</body>
</html>
Or save the CSS and Javascript as seperate files and link them in (for files in the SAME FOLDER this would work):
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="./styles.css">
</head>
<body>
<script src="./app.js"></script>
</body>
</html>
Also note that you can have alternatively have your JavaScript in the head of the file, it depends on what you want to load first, the JavaScript or the document.
Edit: No Problem :)
+ 2
thanks now i know