{Carrer web log}
CSS Shorthand Clockwise Rule
Tuesday, January 26, 2010 { 23 Comments }
When I started with CSS one of the most confusing thing was the shorthand rule. For example:margin-top:1px;
margin-right:1px;
margin-bottom:1px;
margin-left:1px;
Also can be margin: 1px 1px 1px 1px ;
Which is which?
If I remember correctly I watched some videos on Lynda.com for CSS, that I heard about the Clockwise Rule end everything was much more clear.
Basically the first is the top margin and everything is going Clockwise right, bottom and left.
I know that many of you are familiar with this rule but also many others are starting with CSS so I hope this can be helpful.
I design this clock only thing to do is match the colors.
We have 4 parameters it starts from 12 o'clock or top-margin and goes clockwise 3 o'clock or right margin, 6 o'clock bottom margin and 9 o'clock left margin.

With 3 parameters:

With 2 parameters:

With 1 parameter:

Did I mentioned that you can do the same thing with padding.
That is it.
P.S If you are beginning with CSS you can also find this article useful: CSS Specificity - Cheat Sheet .
About Me <<<
Name: Vladimir Carrer
vladocar [at] gmail.com
Location: Verona, Italy
I'm a web designer, developer, teacher, speaker, generally web addicted ...
My projects <<<
- ALLAPIS.COM
- Hartija - Css Print Framework
- MySQL Lite Administrator
- Quark Mini PHP CMS
- Formy - CSS Form Framework
- Emastic - CSS Framework
- Malo - CSS Library
- The Golden Grid
- Better Web Readability Project
- Azbuka - CSS Typographical Base Rendering Library
- ClipR - bookmarklet for better reading
§§Previous Posts <<<
- Bulletproof CSS3 media queries
- Distributed Color Palette – Photoshop Tool
- iPhone Grid System
- CSS Mini Reset
- CSS vendor prefixes – Can we all get along
- CSS3 Action Framework
- Minimalistic Wallpaper for iPad
- Photoshop glyphs tester
- Hacker News mini Redesign [Unofficial]
- ClipR - bookmarklet for better internet reading
§Archives <<<
- May 2006
- June 2006
- July 2006
- August 2006
- September 2006
- October 2006
- January 2007
- February 2007
- October 2007
- April 2008
- June 2008
- July 2008
- August 2008
- September 2008
- November 2008
- December 2008
- January 2009
- February 2009
- March 2009
- April 2009
- May 2009
- June 2009
- August 2009
- September 2009
- October 2009
- November 2009
- December 2009
- January 2010
- February 2010
- March 2010
- April 2010
- May 2010
- June 2010
- July 2010
Other Profiles <<<
Content is licensed under a Creative Commons Public Domain License

