If you have ever taken a dive into the CSS code of a layout you liked - only to find something like this:
.object {
margin: 0px auto 20px .8%;
padding: 0em 25px;
}Now first off, how many of you have ever be at a lost as to the direction you were going? Or have to think for a minute to figure out where West is from North? Even more to the point - how many of you have ever heard the old saying "Never Eat Soggy Waffles"? (No, quite that! - I didn't make it up!) Well, for all us humans without GPS systems - this saying stands for "North East South West" which is the clock-wise order of the directions.
---N---
W-----E
---S---When you see something like:
.object {
padding: 10px 25px 5px 0px;
}.object {
padding (is): 10pixels(top) 25pixels(right) 5pixels(bottom) 0pixels(on left);
}
.object {
padding (is): 10pixels(North) 25pixels(East) 5pixels(South) 0pixels(West);
}So just remember that the first element is the top (North) dimension and the rest can be found be saying "Never Eat Soggy Waffles". Now, CSS also has built in pattern recognizers. For instance look at the following code that only seems to cover the padding for the top and right of ".object".
.object {
padding: 10px 25px;
}.object {
padding: 10px 25px (10px 25px);
}.object {
padding: 10px;
}
Would mean this to the computer:
.object {
padding: 10px (10px 10px 10px);
}So, hopefully you can use this tutorial to help you better follow the code of CSS champs. :)
Great tutorial. That really made a lot of sense. Now, if I could only find those kind of tutorials for everything else...