Why we add scripts at the bottom of the file and CSS at the top of the file?
Enhancement of CSS and JavaScript
28520-Jul-2021
Updated on 20-Jul-2021
Home / DeveloperSection / Forums / Enhancement of CSS and JavaScript
Why we add scripts at the bottom of the file and CSS at the top of the file?
Ethan Karla
21-Jul-2021While creating a web page, a developer has to keep in mind that the CSS will be linked at the top of the page and the JavaScript code will be at the bottom of the page.
Because CSS files are used to enhance the look of the HTML page whereas JavaScript is used to make the website interactive. So look and feel is more important than interactive when the page is loaded so most of the website follow these rules.
Hope this information will be helpful for you.
Happy Coding!