Use of * selector in style sheet to reset styles

后端 未结 3 888
隐瞒了意图╮
隐瞒了意图╮ 2021-01-14 09:29

At the moment I am just resetting the styles I need at the top of my style-sheet, like:

html, body, div, fieldset, form, h1, h2, h3, h4, p, ul, li {
    marg         


        
相关标签:
3条回答
  • 2021-01-14 10:08

    I once ran some benchmarking and the *{} reset did not run any slower than the resets - Meyers, YUI and no reset at all.

    The main problem with the *{} reset is that it resets the padding on the input buttons for most browsers but IE keeps some of its padding making it very hard to consistently style the buttons cross-browser.

    0 讨论(0)
  • 2021-01-14 10:12

    Via Google's Speed Recommendations, the wildcard selector is very inefficient. Plus, in the future you might have boxes that you don't want to be reset. By naming each one individually, you get both efficiency and control.

    0 讨论(0)
  • 2021-01-14 10:22

    Why not use one of the standard CSS reset files such as Eric Meyer's or YAHOO's?

    0 讨论(0)
提交回复
热议问题