Many times in my career, I’ve been asked by colleagues and students where to start if one wants to understand the fundamentals of web design and development. As a starting point, I usually point people to Zeldman’s book, Designing With Web Standards, as well as a few other books on HTML5, CSS, and JS.
This morning, while sitting in traffic, I came up with what I think is a good analogy to explain the basics of how HTML, CSS, JS, databases and PHP (or whatever you prefer) work together.
I explain it like this.
Imagine, an empty glass and a pitcher full of water sitting on a desk.
- HTML would be the glass. It’s the structure that holds everything together.
- CSS is how the glass looks. Is it blue? Is it red? Is it tall, or is it short? CSS controls the presentation of the structure (in our case, the glass/html).
- The pitcher holding the water is a database. The water is content. The pitcher holds the ‘water’ somewhere else until you need it. It can be big or small. You can have many ‘pitchers’. You can have only one. You can fill it with whatever you want.
- Pouring the water into the cup is the PHP (or whatever language you prefer). It takes the stuff from the database when you need it, and puts it into the cup.
- Javascript (in it’s simplest sense) are the physics of the scene. For example, it could be how the water behaves when it gets into the cup. Does it splash everywhere? Is it frozen? Is it hot? Does it float away? Does it turn into Coke after someone has consumed it?
I realize this is a pretty broad generalization, however for a beginner – I believe it could be a good visual metaphor to explain the main systems working behind the web.

