Hi Enrique,

I've tested the solution that David suggested and it's working =)
I've tested also your code and maybe your solution it's more suitable =) But David's one is faster and easier (in fact, it's just one line of code) so I've choose that one.

Anyway, thanks a lot for your help. I've learned something new about JavaScript =)

Regards.


J.Enrique Ruiz-Valenciano escribió:
Yes, if it is possible, but note that the portlet generates a fragment of the HTML, then you must inject the reference to the CSS file in the HTML page. You can do it by including the following Javascript in the portlet JSP pages:

<script type="text/javascript">
   var stylesheetLink = document.createElement('link');
   stylesheetLink.type = 'text/css';
   stylesheetLink.rel = 'stylesheet';
   stylesheetLink.href = '${renderRequest.contextPath}/css/portlet.css';
   document.getElementsByTagName('head')[0].appendChild(stylesheetLink);
</script>


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?

Thanks in advance,
Enrique

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to