How to Link CSS and JavaScript to HTML File

This tutorial will show you how to link to CSS and JavaScript files within an HTML file. 

Step 1. Make sure that all of your files (HTML, CSS and JS) are located in the same folder.

Step 2. Open the HTML file in Visual Studio Code, and to link the CSS file to HTML file. Under the <head> part, insert the code:

<link rel=”stylesheet” href=”your_CSS_file_name”>

Step 3. Under the <body> part, insert the code:

<script type=”text/javascript” src=”your_JS_file_name”></script>

After finishing the program code, the program created in the CSS and JS code must be applied in the HTML when you open the HTML file.

1 thought on “How to Link CSS and JavaScript to HTML File”

Leave a Comment

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