Hi,
I would like to apply a custom, code-generated CSS style to some elements on the fly. How can I do this?
There is setStyleName, which sets CSS style name, but it can only apply a pre-existing CSS class, and I need to create my class definitions on the fly. Is there a way to set CSS style directly, and not via a class?
Or is there a way to apply multiply CSS classes at once? (If there is, then I can pre-define the building blocks in static CSS, and apply the combination I need on the fly.)
* * *
An other aproach would be to generate the CSS files on the server side, with some servlets, but this would invole much more complexity than I would like to introduce for something as simple as this.
What is the recommended approach for this?
Thank you for your help:
Csillag
I would like to apply a custom, code-generated CSS style to some elements on the fly. How can I do this?
There is setStyleName, which sets CSS style name, but it can only apply a pre-existing CSS class, and I need to create my class definitions on the fly. Is there a way to set CSS style directly, and not via a class?
Or is there a way to apply multiply CSS classes at once? (If there is, then I can pre-define the building blocks in static CSS, and apply the combination I need on the fly.)
* * *
An other aproach would be to generate the CSS files on the server side, with some servlets, but this would invole much more complexity than I would like to introduce for something as simple as this.
What is the recommended approach for this?
Thank you for your help:
Csillag
Comment