开发者

<noscript> for CSS only?

Is it possible to turn of CSS in some parts of page? I can use <noscript>, but it turn javascript also...

Problem is that I have lots of glo开发者_高级运维bal styling for lots of elements on page, and now I need to insert new ones ( lot's of new ones ), and I can't go one by one 1000 elements and change them...

Is it possible to do this without changing one by one?

Also, there is font-size: 70% scaling, and I can't overwrite that in my codes...

So how can I block this? Something like <noscript> but only for css ?


<noscript> does not turn off javascript, it gives code that is rendered only if javascript IS turned off.

I'm not entirely clear what you mean here. I think you mean that you want to apply very different styling to some new pieces in some of your pages. If they are in contiguous blocks you could put them in a div, and use that in your new styles. E.g. say you have:

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>

Then you could do:

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>


You could use the find and replace tool found in many IDEs to replace the old bad css with your new better css or just remove it outright

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜