• Post Reply Bookmark Topic Watch Topic
  • New Topic

css not working in JSF

 
Davie Lin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey can someone help me with this issue, I am sure it's very simple I am just not sharp enough to see it.
Here is my style.css


Here is the facelet snippet for the css reference


I want to use it in


I omit the other attribute to keep it simple here to read
currently, it only align to left for the output text and I want it to align to right
I have tried both



Neither of them worked. I can do what I want by using style attribute in the tag but I want to use css
Can someone help me please? thank you so much
 
Radu Mircea
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

h:panelGrid has columnClasses attribute which represents css class for coresponding column, for instance you have

<h:panelGrid columns=4 columnClasses="styleForCol1,styleForCol2.styleForCol3,styleForCol14" ... />

so try something like this:

<h:panelGrid columns=4 columnClasses="label,label,label,label" ... /> supposing that you want to have label style for all your 4 controls from panelGrid.

Regards,
Radu
 
Davie Lin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Thanks Radu

actually, I use



Instead of columnClasses, I only wanted to align the text for output label, not the input text field
columnClasses will align everything

It's also strange that none of the styleClass attribute worked yesterday but it works today, probably because I relaunch the application.
 
Radu Mircea
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeap, after making css changes the browser must be refreshed ,so that new styles may be loaded.
 
Abdullah Dokuyucu
Greenhorn
Posts: 24
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This renders a html <label> tag. When you set its width, it doesn't do anything. Wrap it with <div> and style that instead.
 
Abdullah Dokuyucu
Greenhorn
Posts: 24
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would recommend using Chrome as test browser, when you right click anything and choose "Inspect Element", you get lots of useful information in situations like this.
 
suresh dasari
Ranch Hand
Posts: 121
Chrome Eclipse IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
event if you go with firefox, you have web developer addon which is most usefull in debugging this kind of problems.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!