Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resetting margin & padding for every element. The most efficient way

I am lost as to the reasoning behind most of the CSS reset style sheets (e.g., Eric Meyer's, Yahoo reset sheet). They essentially all do the same. However, what is the most efficient way to select every element on page?

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video { margin: 0; padding: 0; }

vs

* { margin: 0; padding: 0 }

I can tell intuitively it is the latter, yet, all of those reset sheets use the former.

like image 943
Gajus Avatar asked Nov 04 '22 09:11

Gajus


1 Answers

I would agree that The asterisk would be the most efficient. However after some research I found another post on this site about how harmful it can be to use the asterisk.

(why) is the CSS star selector considered harmful?

like image 119
Chillie Avatar answered Nov 09 '22 14:11

Chillie