Live data from Hacker News

Ask HN: What's your most useful CSS or JavaScript trick?

news.ycombinator.com

1–7 of 7 posts

Re: Ask HN: What's your most useful CSS or JavaScript trick?

#5
Simple doctype:

Script tags just work (no need for type="text/javascript":

CSS

Understand how to do general vs specific border/margin/etc assignments and how they cascade. Useful for generic

classes:

.class1{ border:1px solid #000; }

.sub_class1{ border-bottom:2px solid #cc0000; }

JS

0|3.14 === 3, vs Math.floor(3.14) === 3

Re: Ask HN: What's your most useful CSS or JavaScript trick?

#7

CSS Reset. Every project starts with a full reset.

Full Reset? As in * { clear everything }?

Look up the Eric Meyer CSS reset. It saves tons of time with cross-browser compatibility issues straight from the beginning.