停止要在代码的特定部分应用的CSS样式 [英] Stop CSS styles to be applied in particular sections of the code

查看:124
本文介绍了停止要在代码的特定部分应用的CSS样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题可能听起来有点怪异/新手/愚蠢。请随身携带。

This question may sound a bit weird/novice/stupid. Please bear with me.

以下代码是我使用CSS创建的网页的一小部分,
HTML和冷灌装。

The below code is a small portion of a webpage I have created using CSS, HTML and coldfusion.

        <head>
    ---------------------Part 1--------------------------------------
    <CFIF CompareNoCase('#aid#', 0)>   
                <cfinclude template="show.cfm">
        <cfabort>
    </CFIF>
    -----------------------------------------------------------------

    <link rel="stylesheet" href="styles/style.css?1322665623">
        </head>
---------------------------PART 2------------------------------------
<body id="wp-home">
<div id="wrapper">
  <div class="header left">
    <h1><a href="index.cfm" class="right logo">Name Of Client</a></h1>
    <div class="tagline">
      <span class="left blair"><a href="index.cfm" class="homelink">home</a></span>
      <span class="headerline"></span>
      <span class="right blair"><a href="index.cfm" class="homelink">antiques</a></span>
    </div>
  </div>
 --------------------------------------------------------------------

如你所见,我已经包含了一个css文件,style.css包含正确显示PART 2所需的所有样式类。

As you see, I have included a css file, style.css which contains all the style classes required to display PART 2 correctly.

问题是,每当第1部分active(为true),同样
css也应用于文件SHOW.CFM中的元素。这完全弄乱了页面的原始显示。

Problem is, whenever part 1 is active ( is true), the same css is applied to elements in file SHOW.CFM also. This totally messes up the page's original display.

暂时我在链接下面放置了一个标记,用于停止页面处理和加载css文件。

For the time being I have placed a tag below the link to stop page from processing and the css file being loaded.

我已经检查show.css多次,可以确认没有使用styles.css中的类。

I have checked show.css multiple times and can confirm that no class from styles.css is used in it.

因此,我的问题是如果我可以停止style.css的样式应用于从SHOW.CFM加载的元素

Hence, my question is if I can stop the styles from style.css to be applied on elements loaded from SHOW.CFM

如果问题是疯狂地愚蠢,请原谅我;)

Pardon me if the question is insanely stupid ;)

推荐答案

如果选择器匹配,

您可以更改您的选择器,以阻止它们与元素匹配您不希望它们匹配,或者您可以覆盖该部分中的所有规则。

You can either change your selectors to stop them matching the elements you don't want them to match, or you can override all your rules in that section.

这篇关于停止要在代码的特定部分应用的CSS样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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