如何使css属性无效? [英] How can I nullify css property?

查看:600
本文介绍了如何使css属性无效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上我有两个外部css在我的页面。第一个 Main.css 包含所有的样式规则,但我没有访问它,因此我不能修改它...我可以访问第二个文件 Template.css ,因此我需要覆盖 template.css中的 Main.css ,这很容易为此我必须更改的值,但如何删除一个属性完全?比如说一个类 .c1 height:40px; 如何摆脱这个height属性? >

Basically I have two external css in my page. The first Main.css contains all style rules but I don't have access to it, and hence I cannot modify it... I have access to a second file Template.css , so I need to override the Main.css's values in template.css, this is easy for which I have to change the value, but how do I remove a property entirely? like say a class .c1 has height:40px; how do I get rid of this height property?

推荐答案

您必须将每个单独的属性重置为其默认值。

You have to reset each individual property back to its default value. It's not great, but it's the only way, given the information you've given us.

在你的例子中,你会这样做:

In your example, you would do:

.c1 {
    height: auto
}

您应该在这里搜索每个属性:

You should search for each property here:

https://developer.mozilla.org/en-US/docs/Web/CSS/Reference

例如, height


初始值:auto

Initial value : auto

这篇关于如何使css属性无效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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