是否可以重置所有继承的CSS属性? [英] Is it possible to reset all inherited CSS propeties?

查看:139
本文介绍了是否可以重置所有继承的CSS属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何重置CSS文件中类的所有继承属性?我需要能够在元素上设置新的属性,而没有对其产生影响的预定义属性。

How do you reset ALL inherited properties for a class in a CSS file? I need to be able to set new properties on elements without pre-defined properties having an effect on it.

这只能使用CSS吗?

我不是在说CSS重置,如:

I am not talking about a CSS reset, such as:

body {
    margin:0px;
    padding:0px;
}


推荐答案

你可以一个一个地覆盖你的css属性,到目前为止没有自动的。

You cannot reset css properties, you can overwrite your css properties one by one, nothing automatic so far.

* {
    property:inherit
    ...
    ... long list of all .css properties ...
    propertyZ:inherit
}

和可能(wishing))即将开始:初始

and maybe (wishing)) comming soon :initial

a href =http://stackoverflow.com/questions/15901030/reset-remove-css-styles-for-element-only/15903168#15903168>重置/删除元素的CSS样式

See this answer : Reset/remove CSS styles for element only

这篇关于是否可以重置所有继承的CSS属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆