Override reset.css with browser defaults

2019-07-04 04:30发布

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?

标签: css css-reset
2条回答
欢心
2楼-- · 2019-07-04 04:49

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; 
}
查看更多
Evening l夕情丶
3楼-- · 2019-07-04 05:13

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:

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

查看更多
登录 后发表回答