时间:2011-03-28 00:29:02

标签: css

是否可以在页面的某些部分转换CSS? 我可以使用<noscript>,但它也会转换为javascript ...

问题是我在页面上有很多元素的全局样式,现在我需要插入新的元素(很多新元素),我不能一个接一个1000个元素并改变它们。

是否可以在不逐一改变的情况下这样做?

此外,还有font-size:70%缩放,我无法在我的代码中覆盖它...

那我怎么能阻止这个?像<noscript>这样的东西,但仅限于css?

2 个答案:

答案 0 :(得分:1)

<noscript>不会关闭javascript,它会提供仅在javascript被关闭时呈现的代码。

我不清楚你在这里的意思。我认为你的意思是你想要在你的某些页面中对一些新作品应用非常不同的样式。如果它们是连续的块,你可以将它们放在div中,并在新的样式中使用它。例如。说你有:

的CSS:

p {color: green; font-family: serif;}
a {color: blue;}
/* lots and lots of other declarations */

HTML:

<p>Here is a paragraph, there are a lot of these</p>
<p>Here is a paragraph I need in the new style, there are a lot of these too!</p>

然后你可以这样做:

的CSS:

p {color: green; font-family: serif;}
a {color: blue;}
/* lots and lots of other declarations */

.newStyle p {color: black; font-family: sans-serif;}
.newStyle a {color: red;}
/* lots and lots of other declarations */

HTML:

<p>Here is a paragraph, there are a lot of these</p>
<div class="newStyle">
  <p>Here is a paragraph I need in the new style, there are a lot of these too!</p>
</div>

答案 1 :(得分:0)

您可以使用许多IDE中的查找和替换工具,用新的更好的CSS替换旧的坏css,或者直接将其删除

相关问题