English 中文(简体)
• 进口
原标题:Overwrite CSS class selectors without !important

我只字面写一个小字面的UI方言,供浏览。 问题在于,用户可以为网站设计自己的主题,其中可能包括内容选择器(h1{......}, div{......}等),这些内容超越了我方言编排格式。 方言是分量元素,由一门班级选择人组成(由于该方言可能出现多次,该剂量不奏效)。 是否有办法阻止影响方言词典的用户模版的元件选择,而不必使用巨大的剪辑风格和使用<代码>! 进口者,用于方言词典的每一风格? 问询股的图书馆如何像在方言箱里的j Query UI风格?

例如,用户主题包括:

input {color:nuts; height:bananas; width:crazy; background:morenuts; }

The UI s cs:

.ui_modal_wrap input {color:red; border:1px solid black;}

The UI s html:

<div class="ui_modal_wrap>
<input type="text" name="#" />
</div>

问题仍然是,我不得不用大量 c子来做 ,因为你确实能够写出一个用户可以适用的所有特性的 c(例如,高和宽度元素仍然会打破束缚,因为胎儿剂量不包括高和湿度)。

最佳回答

总的来说,你应当知道,规则的适用(如果两者都采用外部风格)与<代码>规格规则

总的来说,你可以想一分,适用最高分数要素的规则。

在选择链中,每个要素类型都价值一,各等级为10个,补贴价值为100个点。

http://www.ohchr.org。

www.un.org/Depts/DGACM/index_french.htm 封面长度=14点

http://www.ohchr.org。

因此,一般而言,使具体页数规则(你网页的其余部分)不那么具体,让情报和安全部接手。 另一种做法是,你总是在超文本“超级”栏内贴有“超级”标识,例如:

<div id="super">
    <div id="super2">
        //your UI stuff
    </div>
</div>

然后,通过安装<条码>,将CSS用于电离层扰动。 此前,关于这种风格的每一条规则都是如此。

问题回答

除非:

  1. you can filter the user s CSS and remove all !important declarations
  2. you are guaranteed that your css code is inserted after theirs. Then you can use !important on everything to ensure your css has higher specificity.

http://htmldog.com/guides/csadvanced/specificity/“rel=“nofollow”

你们将需要有第二套使用更具体选择的风格,这将超越用户风格所确定的内容。 使用<代码>! 进口只是这样做的一种方式。 查阅CSS 规格以供参考。

传真

<div class="ui-dialog">
    <h1>Dialog Heading</h1>
</div>

CSS:

div.ui-dialog h1 {
    color: red;
}

jQuery UI implement this by providing you with the option to specify a CSS scope when you use the Theme Roller. You could set the scope to .system-scope and then in your 传真 wrap all UI elements in an element with a class of system-scope.





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

Drop down background url in Safari Issue

selectBox.selectCSS { background: url(/Images/replacementSelectBackground.png) top left no-repeat height:auto; } I have an issue in Safari only where the image is not rendering on top ...

CSS specific for Safari

How do you target specifically safari in css with styles?

Aligning textarea in a form

Ive used the following css code to align my form elements: form { position:relative; } form input { position:absolute; left:11em; } However, the textarea element is not aligned correctly with the ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

CSS problem with page footer

I have defined my page footer in the css file as: #footer { position: absolute; height: 50px; text-align: center; background: #66CCCC; bottom: 0px; left: 0px; width: 100%; height: ...

热门标签