Quick Reference: CSS
Mar
2
Written by:
Monday, March 02, 2009 10:11 PM
Are you using proper CSS in your web pages? If you are, good for you! If not, then here's a couple invaluable links, please read on.
I'm told (and read) that table formatting your web pages is dead. RIP. The new way is with CSS, div and span tags. Chances are you've seen CSS before, inline, in a separate file, etc. But have you really done your homework and poked around with CSS? If you're like me, you might have decided it's about time you learned a bit more. So here goes! :>
MSDN: Introcution to CSS
Summary:
- reference a style in the head tag, inline or in an external file (again, put in the head tag)
-
<link href="MyStyleRocks.css" type="text/css" rel="STYLESHEET" />
- o prefix, just html tags followed by { and } will give you your formatting
- Class naming notation starts with dot
- ex ".important {font-family:Arial;}"
- Uniquely change one html element by ID attribute using the pound
- ex #title{font-size: 22pt;} and have the html be
<div>id="title">My Title</div>
- even though you might have the div tag with another set of properties, the pound one wins
- to have multipe tags sharing the same formating/definitions, separate tags with commas
- to have nested tags (only format the title class in the div tag, separate with spaces
- div .title {font-family: Verdana; }
Grab a coffee and get coding! :>