Creating Generic Containers

Sometimes you need to wrap a container around a segment of content because you want to apply some styling with CSS or maybe an effect with JavaScript. Your page just wouldn’t be the same without it Image. But, when you assess the content, you determine that using the likes of article, section, aside, nav, or other elements wouldn’t be appropriate semantically. What you really need is a generic container, one without any semantic meaning at all. That container is the div element (think of a “division”) Image. With a div in place, ...

Get HTML5 and CSS3: Visual QuickStart Guide, Seventh Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.