开发者

JSF 2.1 + RichFaces 4 - Change rich:dataScroller default stylesheet

开发者 https://www.devze.com 2023-03-23 14:40 出处:网络
I have the page which has the following tags: <h:head> <h:outputStyl开发者_开发百科esheet name=\"style.css\" library=\"css\" />

I have the page which has the following tags:

<h:head>
 <h:outputStyl开发者_开发百科esheet name="style.css" library="css" />
 </h:head>

and some kind of dataScroller:

<rich:dataScroller for="productsList" id="scroller" maxPages="10">

Now I'm trying to override dataScroller default css style by adding

.rf-ds { background: black; }

in my style.css file.

I don't see any changes. When I open firebug I see both .rf-ds classes one is coming from my css and is disabled and second one is default dataScroller class.

How can I override default class?


try to add !important to your css like this:

.rf-ds { background: black !important; }

see http://www.electrictoolbox.com/using-important-css/


Try <link rel="stylesheet" type="text/css" href="/resources/css/style.css" /> in your <head></head> .From what I have seen, RichFaces loads CSS attached with <link> after it has loaded its own CSS, giving your CSS precedence. In our project we needed to customize a lot of components's css and IMHO adding !important is not such an elegant solution (its more like a hack). Hence we took this approach.

0

精彩评论

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