2.2. What CSS Alone Can't Do For You

CSS is not designed to provide clever ways to interact with users, or to make dynamic or context-sensitive changes to the appearance of a page. For example, displaying a popup menu when the user hovers the mouse cursor over a page element (e.g. a menu bar) can't be done with CSS alone. Carrying out this kind of design requires the use of JavaScript or some other scripting language.

The reason for this is simple: it's the same reason that a plain HTML page needs scripting to cause interactive and dynamic page changes. An HTML page is static. Once it's been served by the server on which it resides and displayed in the user's browser, you can't change it without an intervening program of some sort.

CSS does ...

Get HTML Utopia: Designing Without Tables Using CSS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.