Shorthand Properties

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:

  1. background-color
  2. background-image
  3. background-repeat
  4. background-attachment
  5. horizontal position
  6. 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


  This article uses material from the Wikipedia page available here. It is released under the Creative Commons Attribution-Share-Alike License 3.0.

Cascading_Style_Sheets/Shorthand_Properties
 



 

Connect with defaultLogic
What We've Done
Led Digital Marketing Efforts of Top 500 e-Retailers.
Worked with Top Brands at Leading Agencies.
Successfully Managed Over $50 million in Digital Ad Spend.
Developed Strategies and Processes that Enabled Brands to Grow During an Economic Downturn.
Taught Advanced Internet Marketing Strategies at the graduate level.


Manage research, learning and skills at defaultlogic.com. Create an account using LinkedIn to manage and organize your omni-channel knowledge. defaultlogic.com is like a shopping cart for information -- helping you to save, discuss and share.


  Contact Us