Fórum

How to include a CSS file with a "media" attribute

donino donino, modificado 10 Anos atrás.

How to include a CSS file with a "media" attribute

Junior Member Postagens: 81 Data de Entrada: 02/07/11 Postagens Recentes
Hi everybody,

I was able to add a specific css file for my portlet application in liferay-portlet.xml (v 6.1 CE):

<header-portlet-css>/path/to/myfile/mystylesheet.css</header-portlet-css>


With this property, it appears Liferay creates a link header without setting a media attribute. However the default value is "screen" , therefore all styles defined in the css file are ignored when printing even if we make use of @media=print selector.

In a JSP file we could do something like this:
<link rel="stylesheet" href="/path/to/myfile/mystylesheet.css" media="all" type="text/css"/>

Please could you advice me how to specify a "media" value when including a css file through liferay-portlet.xml?

Thanks!