0

I am beginner at HTML and CSS and faced the confusion about if it is ok to use *{margin:0; padding:0;} or it really affects performance of the web page. I have already read the other article about it in the platform but some responders say that it affects and some say does not. Please would you give concrete answer if *{margin:0; padding:0;} affects the performance or not. I really need your help.

Mirich
  • 333
  • 2
  • 5
  • 19
  • 5
    *I have already read the other article about it in the platform but some responders say that it affects and some say does not. I do not to whom to believe.* What makes any additional answers you get here more believable? ;) – lurker Nov 27 '18 at 17:25
  • 2
    here is the link differences between reset and normalize. it will help you to know why most of website is using normalize or reboot instead of reseting. [link here](https://stackoverflow.com/questions/6887336/what-is-the-difference-between-normalize-css-and-reset-css) – Shahram Nov 27 '18 at 17:27
  • 2
    why not set up some benchmark tests and D.I.Y it? : – treyBake Nov 27 '18 at 17:29
  • 1
    @lurker, Hey man, yes I know but I meant to say each tries to say their own opinions concerning this issue and I just wanted to get concrete answer with proof if it affects or not. That's it. – Mirich Nov 27 '18 at 17:29
  • 1
    It is "Ok" about performances, as it won't have any important impact. But it is not a good practice. – Quentin Veron Nov 27 '18 at 17:29
  • 1
    that's really opinionated, what you get from the reset is browser consistency - all browsers have the same default values. What you trade off is having a little more CSS to parse, that little more CSS shouldn't make a sensible effect on the performance of the page render though – Velimir Tchatchevsky Nov 27 '18 at 17:34
  • 1
    @QuentinVeron, hey Quentin thank you for your reply, ok if it does not affect the performance then is it ok to use it in real projects, if not should I use normalize.css? if yes then it does not contain padding:0; then what should I do? – Mirich Nov 27 '18 at 17:37

1 Answers1

0

If you reset all elements maybe performance is not big a deal here or difference for performance is not countable, specially nowadays browsers are faster.

By reseting basically you have to write style for every elements and on the other hand you have to think about cross browser consistency and think about bugs like SVG overflow in IE9, font-size rendering for pre element......etc.

  • Basically if you like built in style and care about css file size then use normalize css.
  • If you don't like built in styles like default margin or padding for H1-H6,P..etc and care more about cross browser consistency then use reset css.
Shahram
  • 300
  • 1
  • 7