Cascading
Style Sheets
CSS allows for complete control over the style of your html documents.
It is a flexible and logical language, which is also easy to use. CSS
is great for creating liquid layouts and for reducing file sizes by getting
rid of html clutter.
Another great advantage is that with CSS your content is separate from
your layout, making it easy to change the layout of your entire site all
at once.
Class and Id
Class, which is preceded by a dot in the style sheet, marks elements as
part of a group and can be used multiple times. An id, preceded by a hash
mark (#) refers to a specific element that is used once on a page.
For both classes and ids it is best to use names that describe their
function so you remember what the style refers to. If you name the class/id
according to its appearance and later change it, the name won’t
make sense anymore. It is also important to use unique names for classes
and ids and avoid names that already pertain to styles such as body and
table.
Links
When applying styles such as color and text-decoration to the four link
pseudo-classes, remember to do so in the correct order or they won’t
work properly. Link, Visited, Hover, Active. Think of it as LoVe Hate
linking so you won’t forget. (Courtesy of CSS Crib Sheet).
Div and Span
Div and span have no inherent properties. This makes them great for applying
classes to block elements (div) or inline elements (span). |