28 November 2004

Best CSS Tip Ever

who knew resetting all the whitespace would be so so useful

It’s so simple, but ever since reading this … it has saved me allot of headaches. Sure it gives me more work other places, but I don’t know why.. but I love it !

* {
padding: 0 0 0 0;
margin: 0 0 0 0;
}

Taken from Global White Space Reset »

 

Comment

what they saidwho said it
You don’t need “0 0 0 0”, “0” is enough… ;-)

CSS presumes the last numeric to suffice for the rest, so if you want a 10px top margin, but no margin on the others, this will also work:
margin: 10px 0;

ta
2004-11-29
digits
True, I am using it in it’s original format. I am also a little weary about the automagic stuff … what’s a few characters for sake of clarity. 2004-11-29
DannyB
Glad my little trick helped you out :) 2004-12-05
Andrew Krespanis
I am glad too ! 2004-12-06
DannyB
margin: 10px 0 will not work as 10px 0 0 0 but rather 10px 0 10px 0 2004-12-09
Jaro


note: you can only submit after you hit preview


nuff-respec is a weblog written by daniel bulli a senior web programmer in boston, ma.
more >

contact | resume | profile | twitter

recently :::

diversions :::

45+ Amazing Insect Shots in Photography
Insects are one of the most fascinating creatures on earth. There are more than 800, 000 species of insects in the world.
Grayscale color | Stroep Blog
This is how I create a grayscale color in actionscript 3.
Google Flash API
This is great ... google has made this easy ... stay tuned to see what i am working on ...
25 Free Mac Apps That Will Boost Your Productivity
There are many applications that can help you work faster and efficiently. Though, not many applications come cheap.
you still want more »