CSS tips
Through books and on-line resources, I have learned a lot of neat tips regarding CSS (cascading style sheets). Every week, I will provide a different CSS tip to enlighten and educate on the power that Cascading Style Sheets can deliver.
WEEK OF: August 21st 2005
- Separating Content from Presentation
- When setting up a CSS file, you should always think about separating content from presentation.
- By this I mean you should use the XHTML to set up the structure of the page and use the CSS to add the formatting of the text, attributes of fonts, headers, and placements of elements on the page.
WEEK OF: August 14th 2005
- IE Hacks
- There are many hacks whcih you can use to target IE to fix a bug.
- among them are using * html in front of a declaration.
- eg: * html {width:550px;} /*this targets IE only*/
WEEK OF: July 31st 2005
- You are in TRouBLe!
- A short hand way to list your borders, margin, padding etc. is as such:
- margin: 0 1em 0 .5em;
- The order is always top, right, bottom, left.
- An easy way to remember this is TRouBLe!
- There you have it, think TRouBLe and you will never forget the order!!!
WEEK OF: July 24th 2005
- shorten your hex codes!
- There are instances when using short-hand on your hex codes will work.
- Hex codes are usually 6 characters, but that doesnt always have to be the case!
- #ffffff can be shortened to #fff
- #006699 can be shorten to #069
- #336699 can be shortened to #369
- You get the picture
- this shortens the time you spend coding and helps make your CSS lighter!
WEEK OF: July 17th 2005
- LoVe/HAte your links
- It is important to list your links in this order:
- a:link (L)
- a:visited (V)
- a:hover (H)
- a:active (A)
- thusly, LoVe HAte!. This way they will all behave properly without over-riding one another.


