English 中文(简体)
适当方式将所有要素从项目的外部风格分离
原标题:Proper way to isolate all elements under an element from external styles of project

我刚刚在项目中列入了一个新奇日历。 日历显示了这一点——

<div style="position: absolute;" id="container">
    <table cellspacing="0" cellpadding="0" align="center" class="DynarchCalendar-topCont">         
       <tbody>
          <tr><td>
             // lots of elements inside
          <td><tr>
       </tbody>
     </table></div>

问题是,由于我的项目中的一些风格,日历的观点似乎被歪曲。

div#sel_filters div.fields div {
    margin-left: 10px;
}

div.filters div.fields div {
    float: left;
    padding: 7px 0 0;
}
... and many more which apply to the elements inside

该项目有许多卷宗。 由于我的日历出现在四舍五入内,上述风格也适用于此。 我没有考虑改变上述项目风格,因为这可能会影响到其他项目。

不允许除<条码>条码外的任何风格的恰当清洁方式是什么。 DO I只有这样选择:对<代码>jpanndar.cs的风格适用! ;搜索所有外在特性,这些特性只能由项目组确定,并且人工确定。

如果是这样的话,我可以自由地在项目卷宗之前/之后列入jcalndar.cs。

问题回答

If you load your jscalendar.css after the other CSS files it should overwrite the other CSS directives. If you still have problems, you could add a class to the divs that should behave differently and then add a CSS directive after the others to overwrite the previous ones:

div.filters div.fields div.yourClass {
    float: none;
    padding: 0;
    margin: 0;
}

不幸的是,这样做的正确办法是确定贵国的社会保障局网站。 你们通过将风格适用于直接要素,如<条码>div,将会导致一个疼痛的世界,供今后维持或改变。

避免以一切代价直接捆绑元素,尽可能使用类别,然后使用识别器。 使用诸如<代码>div.foo<>/code>或div#foo等类别或识别符号,但不是直接内容。

你们可以放弃! 现在,在你们的日历中非常重要,但我花了这个时间固定你们的网站,就像你更新日历时一样,你会再次痛苦地回顾一下。

So take the hit now, look at the positive of having learnt how to do things properly and never repeat the same mistake again :)

对集装箱实行独一无二的补贴,并改变你的特别安全局,以反映源自以下因素的遗产:......如果你不得不在公路上继续这样做,那么,直接的搭售将给你去哪儿,但从长远来看,你的花gon会给你带来代价。

但是,我必须同意Moin Zaman,如果你打上了这一障碍,如果你现在愿意照顾到它,那么它就不得不再次发生。





相关问题
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....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

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 ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签