Class and ID Selectors

Use shorthand syntax for classes and longhand syntax for IDs to avoid setting unnecessary defaults and simplify debugging of dynamic class changes through scripting or property changes through pseudo-classes

Background Property Shorthand

When using shorthand to set all background properties in one declaration, use the following order for consistency and compatibility across browsers:

background-color

background-image

background-repeat

background-attachment

horizontal position

vertical position

Use background-image instead of the background shorthand when using ID selectors to avoid inadvertently overriding class-based background-position changes for CSS sprites

List-Style Shorthand

Use list-style shorthand instead of list-style-type for IE6 to avoid the declaration being ignored by the CSS parser

Manage research, learning and skills at IT1me. Create an account using LinkedIn to manage and organize your IT knowledge. IT1me works like a shopping cart for information -- helping you to save, discuss and share.

Manage research, learning and skills at IT1me. Create an account using LinkedIn to manage and organize your IT knowledge. IT1me works like a shopping cart for information -- helping you to save, discuss and share.