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

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
Daniel Bulli2
Glad my little trick helped you out :) 2004-12-05
Andrew Krespanis
I am glad too ! 2004-12-06
Daniel Bulli2
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 :::