1. Home
  2. Computing & Technology
  3. Web Design / HTML

CSS - Cascading Style Sheets

QuickTips Index

First Child Pseudo Selector
The first child pseudo class expands on the child selector to only select the first child of an element.

CSS Padding and Netscape 4
Netscape 4 doesn't play nice with CSS padding, so you need to be aware of that if your readers use this browser.

Cascading Style Sheets Child Selectors
CSS 2 allows you to define properties that are parents or children of other selectors.

Adjacent Sibling Selectors
CSS selectors of elements that are right next to one another. These elements are called adjacent elements or sibling elements.

Cascading Style Sheets 2 Attribute Selectors
With CSS2 we can now define styles based on the attributes within an element as well as the element itself.

How to Choose ID and Class Names
CSS does not allow class and id names to start with a number or other non-alphabetical character. The only exception to this is if you use an escape character - which many browsers don't support.

Using Percentages as Font Sizes
If you are concerned about your site being usable to your readers then setting absolute font sizes is not a good idea. Instead you should use percentages to define the font sizes.

Netscape 4 and Background Images
Netscape 4 doesn't play nice with CSS background image styles.

Class vs. ID
Understanding when to use class and when to use ID is crucial to writing good XHTML documents.

What is Width in CSS?
You might think that width is obvious, but there are several ways to define it and CSS has a very specific definition.

Using the CSS font Shorthand Property
Why write font-family and font-weight and font-size, when you can roll them all up into one shorthand font rule?

Converting the body Tag to CSS
Most HTML body tags are really ugly - crammed with lots of attributes that can be left off of a well-designed XHTML document.

Using Shorthand Notation with CSS margin, padding, and border Styles
Once you remember TRBL you'll want to know what happens if you leave off more fields.

Using Temporary Styles to Convert an HTML Document
Temporary styles allow you to see the structure of a document without having to wade through someone else's code.

Use CSS to Convert Spacer Images
When you are converting an HTML document, you may notice lots of spacer images that define the layout. Getting rid of these will result in a faster downloading page and easier to read HTML.

Flexible CSS Decendants
It reall doesn't matter where you put the decendants to make them work correctly in CSS

How the CSS text-align Property Works
It might seem pretty straightforward, but the text-align property doesn't behave as previous similar HTML tags behaved.

Style the Big Things First
Think globally about your CSS - style those elements that are really common first like paragraphs and divs.

Avoiding Invalid Markup with CSS
The marginheight and marginwidth tags are invalid markup, and yet many people use them all the time. It is easy to replace them with CSS tags that create valid markup.

Cellspacing and CSS2
If you're trying to write valid XHTML with tables, you may run across some problems when you define cellspacing. The border-spacing property is not well supported.

Why Should You Convert to HTML+CSS or XHTML?
Converting an older document to XHTML may seem like a lot of work but there are good reasons to do it.

Staying out of TRouBLe with CSS
Learn how to remember the order for shorthand CSS notation like margin, padding and border.

Using Z-Index Stacking Order in CSS Style Sheets
You may know that using z-index sets the stacking order in a styled document, but ther is another required property to get it to work correctly.

Using @media in Cascading Style Sheets
@media rules with cascading style sheets allows you to define specific styles for specific media types

Using @import in Cascading Style Sheets
@import rules with cascading style sheets allows you to import external style sheets into your CSS

1 | 2

Explore Web Design / HTML

More from About.com

  1. Home
  2. Computing & Technology
  3. Web Design / HTML

©2008 About.com, a part of The New York Times Company.

All rights reserved.