Six Important CSS Techniques

1. Get a Consistent Base Font Size

Until IE finally supports the resizing of text in pixels, this is the best technique to gain full control over your font sizes. By setting the body font-size to 62.5%, that will set your font size to 10 pixels. That way, 1em is equal to 10 pixels.

2. Get Consistent Margins

There are some great CSS resets out there, but I usually don’t need one that goes so far. I like to just remove the margin and padding from every element.

3. Set a Float to Clear a Float

Floating is probably one of the most important things to understand with CSS, but knowing how to clear floats is necessary too. All you need to remember is: Set a Float to Clear a Float.

4. Image Replacement

Sure, there are a lot of different image replacement techniques. But, I think that you get to most benefits from this technique.

5. Faux Columns

It is very common in layouts to have 2 columns next to each other, with one column having a background color, and the other column just being white. Since the columns will almost never have the same amount of content in them, the easiest way to fake this, is to have a 1px tall background image being repeated vertically in the containing element of the 2 columns.

6. CSS Sprites

CSS sprites is the technique of combing images to lessen the number of calls that need to be made to the server.
—————-
Listening to: Common - The Game - Common & DJ Premier
via FoxyTunes

Do Us a Favor:
  • Digg
  • Reddit
  • Facebook
  • del.icio.us
  • Mixx
  • StumbleUpon

Leave a Reply

You must be logged in to post a comment.