On Apr 24, 2007, at 7:57 PM, Enrique Perez wrote:
Hi all,
I was wondering if it's possible to define and use an specific CSS
for JSPs in a portlet. I mean, define a new CSS (in addition to the
portlet decorator) for several HTML elements that are going to be
used when the portlet is rendered.
I think it's not possible since the LINK tag necessary to load the
CSS in the JSP or the HTML must be placed in the head section of
the page, and that section is not available from inside the portlet.
Am I wrong and that can be done? Or the only way is to define
inline styles?
Yes, your portlet can provide its own CSS resources in a JSP
You an simply reference the CSS in your JSP, but you need to put the
context path in your reference to the CSS otherwise it will not be found
Note that the 2.0 portlet spec will address this deficiency in the
1.0 spec of including resources from portlets in general
---
If you would like your portlet to take the style of the current
decorator, we define CSS in the decorators
See the docs here:
http://portals.apache.org/jetspeed-2/guides/guide-decorators.html
---
Additionally, the portlet spec has support for CSS that you can use
to "skin" your portlet, so that its styles can change as the end user
changes the decorator theme
See section (PLT.C) of the portlet spec