tags:

views:

133

answers:

5

I never forgot and always use shorthand for margin and padding because it runs clockwise, but how do you remember the others?

Do you use CSS shorthand wherever possible?

What are the best ways to remember different shorthands?

Update:

I also found 2 good shorthand Cheat-sheet.

  1. Png - http://www.catchmyfame.com/wp-content/uploads/2009/07/CSS-Shorthand-Cheat-Sheet.png
  2. PDF - http://www.eddiewelker.com/wp-content/uploads/2007/09/csscheatsheet.pdf
+3  A: 

I personally am not good at memorizing such things, so I use the specific attributes, background-position background-image background-repeat etc. instead of the shorthand.

I find it's less error prone, and makes for more maintainable code: You can search & replace specific settings project-wide, which is impossible when using shorthand.

Pekka
+1 ur point is good
metal-gear-solid
+1 definitely for readability vs shorthand which can lead to confusion of the intent of the CSS (or insert your choice of language here).
Metro Smurf
+8  A: 

Here’s a decent CSS shorthand cheat sheet (PDF).

Paul D. Waite
+1 excellent ref
Jonathan Fingland
+1 great link if you like shorthands.
Pekka
i will print shorthand cheat sheet and stick on my desk's side wall
metal-gear-solid
+2  A: 

Use an editor that understands the shorthand syntax and gives you some degree of auto complete on them. I too don't need one that tells me margin goes top, right, bottom, left, but it is useful to have one that tells me the options for background for example.

Visual Studio does this - it won't be the right choice for everyone obviously, but if Visual Studio does it I'm sure there must be many others that do too.

David M
Dreamweaver has pretty decent HTML and CSS autocomplete too.
Paul D. Waite
A: 
  • ctrl+T for new tab
  • ctrl+K for Google search bar
  • "css font shorthand" and done!
Summer
+1  A: 

I've previously had only the difficulty to remember the order to declare the a pseudoselectors link, visited, hover and active (it actually matters!). Here I use the LoVe HAte mnemonic for.

BalusC