|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
CSS: CLASS, ID, DIV, and SPAN Confusion
I am having trouble understanding what exactly the CLASS, ID, DIV, and SPAN elements and attributes do.
What are there purposes? How do the relate to each other? When should one be used and not another? In laymens terms please. Thanks |
|
#2
|
||||
|
||||
|
Class contains rules that can apply to any element. Think of class as referring to any persons having a certain set of attributes.
.scots { hair-color: red; eye-color: blue; } ID refers to a single, individual, unique element. #fergus { demeanor: grouchy; } No two elements can be named fergus, but any number may be of the class scots. div is a block element that acts as a container. Rules may be applied to a div by id or class. To make things a bit more confusing, a div may be defined as inline. span is an inline element that acts as a container. Rules may be applied to a div by id or class. To make things a bit more confusing, a span may be defined as block. HTH cheers, gary
__________________
There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing. My html and css workshop, demos and tutorials. Ask a better question, get a better answer. |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > CSS: CLASS, ID, DIV, and SPAN Confusion |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|