Selecting Elements, Id's or Classes

When using an internal (or external for that matter) style sheet, styles get applied to HTML Elements or to Id's or Classes that we create. For example, styles can be applied to the body, paragraphs, divs, links, and headers. For each of those elements, we simply define the style we want to apply to all of them on our page in the style sheet definitions.

There are times, however, when we want different styles in different parts of our page. In order to do that, we can create id's and classes and "name" individual HTML elements and apply specific styles to those. Id's are unique, they should be used only once on a given web page. Classes can be used as many times as you'd like, simply assigning a class to whichever elements you want to have that style. In the internal style section of the document, ids are designated with a '#', classes with a '.' .

You can assign multiple classes to an element.