如何禁用元素上的所有样式?任何属性设置元素的所有属性为一个没有一个去? [英] How do you disable all styles on an element ? Any property to set all attributes of an element to none all in one go?

查看:206
本文介绍了如何禁用元素上的所有样式?任何属性设置元素的所有属性为一个没有一个去?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将telerik的radEditor嵌入我的page..its继承主页的css属性... like H2是蓝色的...有背景颜色...

I am embedding telerik's radEditor in my page..its inheriting css properties from the master page..like H2 is in blue color..its got background color...

我应该在我的自定义css类(一个专门为radEditor),所以它覆盖所有的主页的css属性,并不适用于标题标签。

what should I type in my custom css class (the one exclusively made for radEditor) so it over rides ALL the Master page's css properties and applies nothing to heading tags??

我写道: -

h2{color:black;background-image:none;}

下拉列表在我的RadEditor..it仍然是应用css从母版页。我需要搜索所有应用在母版页中的属性,并在我的自定义css文件中将它们逐一设置为一个?/

still h2 tag doesn't appear smaller that H1 tag in the drop down list in my radEditor..it still is applying css from master page..do I need to search for ALL the attributes being applied in master page and set them to none one by one in my custom css file ?/

推荐答案

AFAIK,CSS中没有这样的可能性。您有两个选项:

AFAIK, there's no such possibility in CSS. You have two options:

1:尽可能选择您的H2元素,然后应用您的css删除样式。伪代码,因为我不知道你的HTML的结构:

1: Select your H2 elements as specifically as possible and then apply your css to remove the styling. Pseudo code, as I do not know the structure of your HTML:

#master_page #page h2{font-style:none; etc...}

2:使用JavaScript动态删除所选元素的所有格式。这个解决方案意味着你不能重新排序的元素,所以我想这不是你要找的。只是要完成:)

2: Use JavaScript to dynamically remove all formatting of a selected element. This solution however implies you could not restyle the element at all, so I guess it's not what you're looking for. just to be complete :)

这篇关于如何禁用元素上的所有样式?任何属性设置元素的所有属性为一个没有一个去?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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