How to insert css code, javascript into different html files easily

Write code – html code, php, css, javascript. dll in one page or one file will make us tired. Tired of scrolling, tired of using the find function to find a code, tired of scrolling here find here.

But that’s how it works haha. But we can reduce this feeling by separating the codes.

Separate CSS, Javascript, PHP code. etc

We can separate the code that was once an html file into several parts:

  • css code into style.css file
  • javascript code into script.js
  • php code to home.php

The first thing we do when we separate the code – the code is to create a new file with a file type that matches its contents. Like when we will separate the css code then we will create a file with type .css later the file will be filled with css functions

Writing css functions separately will help us to be more focused and look more structured in writing code. After we place the css code, don’t forget to click save or ctrl + s, save the file in a html, js, css, php file folder. We can also separate the file in several folders, such as:

  • folder with name html
  • folder with name css
  • folder with name js
  • folder with name php

The names of the folders are free to change, friends, to the names that suit your wishes, but for writing the directory must match where you store it. the following is an example of code to enter css code into html

Because I save in one folder eat for href I just write the file name and type. the picture above also contains the code to enter the jasvascript code into html for the process not much different from separating the css code.

How is it not too difficult to separate the html codes ? Please, friends, try to separate the code, if there is something you want to ask, I’m waiting for your comments.

Thus my review of how to enter css code, javascript into html. Hopefully my review can be useful for all of my friends. Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *