从特定的DIV中删除所有CSS

use*_*437 5 html css

可能重复:
取消继承(重置)特定元素的CSS样式?

我有一个页面可以加载具有不同CSS属性的外部CSS文件。

是否可以在同一页面内创建一个元素,并且专门为该元素创建一个不加载任何CSS的元素?

例如:

<style type="text/css">
p {
    background-color:#000000;
    width:550px;
}
</style>
<p>This should get the P styling from the style tag</p>
<p>This should NOT get the P styling</p>
Run Code Online (Sandbox Code Playgroud)

Ric*_*der 1

这正是类的设计目的。

<style type="text/css">
.class1{
background-color:#000000;
width:550px;
}
</style>
<p class="class1">This should get the P styling from the style tag</p>
<p>This should NOT get the P styling</p>
Run Code Online (Sandbox Code Playgroud)

根据记录,不要使用仅用于演示的 class1 之类的名称。对有意义的类使用描述性名称。