0

I try to put two different styles in two distinct p:clock element in the same page. This way described in the User Guide under "skinning"is to use .ui-clock in css page.

But this will apply the same style on the the two p:clock ! How can I define two different styles?

The problem is that p:clock has no styleclass or class attribute so even if I overide the primesfaces css I won’t be able to define two different style.

  • Hi, one suggestion is to learn basic html and css when doing web development. Especially the 'cascading' part... and by looking at the generic question behind your specific question and search for related q/a on stackoverflow – Kukeltje Jan 01 '19 at 13:42
  • 1
    Possible duplicate of [How do I override default PrimeFaces CSS with custom styles?](https://stackoverflow.com/questions/8768317/how-do-i-override-default-primefaces-css-with-custom-styles) – Kukeltje Jan 01 '19 at 13:44
  • you did not understand my question! I’m don’t ask how to overide primesfaces css, that I know very well how to do it! the problem is that the p: clock has no class or style class attribute ! So even if I cascade the css right I won’t be able to spicify two different style for the two p:clock ! Please try to understand well the sens of the question before answer! And it’s not a duplicate question ! – Rekillme Re Jan 01 '19 at 14:18
  • What about to define second `p:clock` in different xhtml file and specify different styles per each page by setup different `.ui-clock` on those pages, and `include` second page in first. – Vasil Lukach Jan 01 '19 at 15:06
  • yes, I had thought of that. but it is a complicated solution because I have both clock side by side. the solution that I found and that works well is to define the second clock in a
    and in the css: div#clockSec span {the style}
    – Rekillme Re Jan 01 '19 at 16:45
  • 2
    I fully 1000% percent understand (understood) your problem **within the initial context you gave** and in that case it is a 1000% duplicate and your question did not show understanding some basics of css. And instead of blaming me not having tried to understand the question before answering and then silently adding more context (p:clock not having a (style)class and only stating that in a comment.) But... JSF has passTrough attributes. So you can add a 'class' attribute that way and still have it present on the html output and use it in selectors. The duplicate is now a valid duplicate, check! – Kukeltje Jan 02 '19 at 09:01

0 Answers0