Fingerprints
When I design, I tend to attempt the shorthand methods of CSS which means that I use margin: 2px 4px 1px 3px; instead of writing each margin out. Of course, to prevent confusion (in myself), I tend to use my monitor to remember the order. So if you ever walk in my house and find me touching my monitor in the order of top-right-bottom-left, you’ll know why!
(And I hope that I’m not the only one who does odd stuff like that, lol!)
February 17th, 2004 at 9:12 am
Freak! Actually that’s a very good way to remember… but I must ask: “Why?” Why not type them out long-hand? That way there is never any confusion.
February 17th, 2004 at 10:10 am
Because with CSS3, the “long-hand” will start to get phased out. Short-hand was introduced with CSS2 so people would start getting used to it, and will stick around from now on. Mind you, the long-hand version will be around for a very long time still (much like the FONT and CENTER tags,) however more and more developer, such as myself, will use the short-hand version more often.
Also, programmers are lazy:
margin-top : 0px;
margin-right : 0px;
margin-bottom : 0px;
margin-left : 0px;
That’s 78 characters (including the hard returns on each line, and the spaces around the colon, which aren’t required, but that’s how the validator works.) Now short-hand:
margin : 0px 0px;
That’s 22 characters. Even if the margin’s were different sizes, forcing you to put all four in when writing short-hand, that’s still another 3 to 5 characters per side. That’s WAY less than the long-hand version. Think of those modem users who will thank you later.
And denise? May I suggest small sticky notes (or even a piece of tape) on each side of your monitor, with the words ‘top’, ‘right’, ‘bottom’, ‘left’ writtin on them, and directional arrows pointing to the next side you need to go to? (Go ahead, hit me.)
On a side note, can’t you write it even shorter if the margins are all the same? IE: margin: 0px;
February 17th, 2004 at 8:40 pm
I’ve only one word for you: clockwise. Heh…
February 18th, 2004 at 3:04 pm
oh thanks! that’s a good hint. i never knew how to remember it myself, now i know the trick. lol
February 18th, 2004 at 6:02 pm
((((WAVE)))
February 18th, 2004 at 11:03 pm
Yes you can write it even shorter if all four sides are the same. You can have one, two, three or all four sides specified:
margin : 0px;
– all four sides are 0px
margin : 0px 5px;
– top and bottom are 0px, left and right are 5px
margin : 0px 5px 10px;
– top is 0px, right is 5px, bottom is 10px, and left is assumed to be 0px because it simply isn’t listed.
margin : 0px 5px 10px 15px;
– top is 0px, right is 5px, bottom is 10px, and left is 15px;
February 20th, 2004 at 8:13 pm
Um… :huh: ok…not a single one of this made sense, yet you got a lot of responses from people and not a one of them are clueless…I’m deprived
LOL, JK…but I still don’t know what all these things mean, hehe.