Using div elements

Objectives

In this lessons, students will learn:

  • How to use <div> to create the structure for a one column layout

What is the difference between id and class attributes?
IDs are unique and classes are not.

  • We can have only one element with a specific id attribute to the page. The id attribute is about identification
  • We can have multiple elements with the same class attributes on a page. The class attribute is all about classification
  • id = one; class = many

By creating divs for different sections of the document and nesting these with an id attribute we can create one-column layout.

one-col-layout-ids
A One-column Layout


one-col-ids-code

 


Download Files
One-column Text

Advertisements