覆盖CSS类 [英] Overriding CSS classes

查看:100
本文介绍了覆盖CSS类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Ruby on Rails 3.0.9,jQuery 1.6.2和jQuery UI。我想覆盖我的标签页的一些CSS class 属性, / a> 更改由 ThemeRoller 生成的原始CSS文件。

I am using Ruby on Rails 3.0.9, jQuery 1.6.2 and jQuery UI. I would like to override some CSS class attributes for my tabs without change the original CSS file generated by the ThemeRoller.

我该如何做?你建议什么?

How can I do that? What do you advice about?

PS:我想在不修改jQuery UI CSS文件的情况下设置样式,以便在将来的开发中, - 生成该文件,而不会丢失我的自定义CSS语句。

P.S.: I would like to style my tabs without modifying the jQuery UI CSS file at all so that, in future developments, I can "re-generate" that file without lose my custom CSS statements.

推荐答案

这是很容易实现。 CSS应用基于加载顺序的样式。要覆盖任何样式,需要在核心样式表之后加载。

This is quite simple to achieve. CSS applies styling based on load order. To override any style, it needs to be loaded after the core stylesheet.


  1. 加载您的jQuery UI CSS。

  2. 加载您的自定义CSS文件。

在自定义CSS文件中,您可以使用相同的标记在核心UI CSS文件中。

In your custom CSS file, you can override your tab structure using the same markup found in the core UI CSS file.

这将允许您重新生成和替换核心文件,而不会失去您的自定义。

This will allow you to re-generate and replace the core files without losing your customization.

这篇关于覆盖CSS类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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