Override reset.css with browser defaults

自闭症网瘾萝莉.ら 提交于 2019-12-10 19:18:36

问题


I know this might sound like a strange question but I actually need to override a CSS reset file with the browser defaults (so the other way around than normal).

So when my reset.css states

li{
   padding: 0;
}

I want to override that with the browser defaults.
Setting

li{
   padding: auto !important;
}

doesn't work though.

Is there a way to do this?


回答1:


The default stylesheets are different from browser to browser and from version to version. You can apply the browser's default stylesheet by using the respective CSS files:

  • Mozilla's default CSS
  • WebKit's default CSS
  • Opera's default CSS
  • IE9's default CSS

The much simpler solution might be to just remove the reset styles.




回答2:


You can look up individual properties and set those as needed. This is very common in CSS but you might also use the "initial" value to do the same thing implicitly and with less effort.

For example,

h1 {
    color: initial; 
}


来源:https://stackoverflow.com/questions/13272262/override-reset-css-with-browser-defaults

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!