Learning outcomes:
- The purpose of HTML, CSS, and JavaScript.
Notes:
Purposes of the main web authoring technologies:
- HTML is for structure and semantics (meaning).
- CSS is for styling and layout.
- JavaScript is for controlling dynamic behavior.
-
Their place in the larger ecosystem, and the fact that they are not the only web technologies.
-
Why separating the layers is a good idea.
Notes:
Separation is a good idea for:
- Code management and comprehension.
- Teamwork/separation of roles.
- Performance.
- The fact that in reality, the separation is not always clear.
Notes:
- A prime example is the case of using JavaScript to dynamically update CSS styling on-the-fly in response to app state changes, user choices, etc.
- Often this is done by modifying the
Element.style.x
properties, which results in inline CSS being injected into HTML. A better strategy is to add/change classes on elements to avoid inline CSS.
- Much more severe is the case of JavaScript frameworks that use various HTML-in-JavaScript or CSS-in-JavaScript custom syntax, which results in a lot of mixing of syntax types.
Notes:
Progressive enhancement is often seen as unimportant, because browsers tend to support new features more consistently these days, and people tend to have faster internet connections. However, you should think about examples relevant to the modern day — cutting down on decoration to make a mobile experience smoother and save on data, or providing a simpler, lower-bandwidth experience for users in developing countries who might still pay for home internet by the megabyte.
This bleeds over into responsive design, which is covered later on in more depth.
Resources: