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

recently :::

diversions :::

Using Flash And Staying Standards Compliant
Anyone who has ever worked with Flash on the web has likely come across the fact that embedding flash into a web page is usually no walk in the park...
A Design is Finished when...
This is probably the hardest part of designing for me.... 23 Pro designers weigh in with their opinions ...
JungleCrazy.com
Find all the Amazon.com products that are discounted by at least 70%
IETester
IETester is a free WebBrowser that allows you to have the rendering and javascript engines of IE8 beta 1, IE7 IE 6 and IE5.5 on Vista and XP, as well as the installed IE in the same process.
you still want more »