HTML and CSS Reference
Let's nest the elements in each
grouping in a <div> element.
Using div s to mark sections
Now that you know which elements belong
in each section, you can add some HTML
to mark up this structure. The common
way to do this is to place <div> opening
and closing tags around the elements that
belong to a logical section. Let's first do this
pictorially, and then we'll come back to the
real markup in a couple of pages.
Here's our cat group .
Labeling the div s
Just by nesting your elements in <div> s,
you've indicated that all those elements
belong to the same group. But you
haven't given them any kind of label
that says what the grouping means,
A good way to do that is to use an id
attribute to provide a unique label for
the <div> . For instance, let's give the
cats <div> an id of “cats” and the
dogs <div> an id of “dogs”.
And li kewise for d ogs