<> The Main Components of Websites <>

- CONTENT LAYER ( .html files )
- PRESENTATION LAYER ( .css files )
- BEHAVIOR LAYER ( js.files )
PROGRESSIVE ENHANCEMENT
- HTML ONLY
- Starting with the HTML layer allows you to focus on the most important thing about your site: its content.
- Being plain HTML, this layer should work on all kinds of devices, be accessible to all users, and load quite quickly on slow connections.
- HTML + CSS
- Adding the CSS rules in a separate file keeps rules regarding how the page looks away from the content itself.
-
You can use the same style sheet with all of your site, making your sites faster to load and easier to maintain.
-
You can use different style sheets with the same content to create different views of the same data.
- HTML + CSS + JS
- The JavaScript is added last and enhances the usability of the page or the experience ofinteracting with the site.
- Keeping it separate means that the page still works if the user cannot load or run the JavaScript.
CREATING A BASIC JAVASCRIPT
- A JavaScript file is just a text file (like HTML and CSS files are) but it has a .js file extension, so save this file with the name add-content . js
LINKING TO A JAVASCRIPT FILE FROM AN HTML PAGE
-
The HTML script element is used in HTML pages to tell the browser to load the JavaScript file (rather like the element can be used to load a CSS file).
- Internal JS

- External JS
