Fórum

How to add the CSS to our portlet?

Bhaskar Koppuravuri, modificado 13 Anos atrás.

How to add the CSS to our portlet?

New Member Postagens: 18 Data de Entrada: 19/01/11 Postagens Recentes
Hi all,

I need to add the CSS to the portlet where the CSS contains image adding URL,but the image is not getting into the portlet..

can any one help how to solve this problem

The following is my css file

body
{
background-image: url("BackgroundImage.jpg") ;


}
p{
text-align: center;
}
Pushpinder Singh, modificado 13 Anos atrás.

RE: How to add the CSS to our portlet?

Junior Member Postagens: 84 Data de Entrada: 21/07/10 Postagens Recentes
In your view add following, where your_protlet is your portlet css file
<link type='text/css' href='<%=request.getContextPath()%>/css/your_protlet.css' rel='stylesheet' media='screen' />
thumbnail
Nguyen Trung Kien, modificado 13 Anos atrás.

RE: How to add the CSS to our portlet?

New Member Postagens: 9 Data de Entrada: 29/06/09 Postagens Recentes
You can use <header-portlet-css> tag add css file to your portlet emoticon
	<portlet>
    <portlet-name>product-registration</portlet-name>
    <icon>/icon.png</icon>
    <social-activity-interpreter-class>com.inkwell.internet.productregistration.social.RegistrationActivityInterpreter</social-activity-interpreter-class>
    <instanceable>true</instanceable>
    <header-portlet-css>/css/product-registration.css</header-portlet-css>
    <header-portlet-javascript>/js/test.js</header-portlet-javascript>
  </portlet>

In your css file:

.ink-fieldset {
    border: 1px solid #781351;
    width: 98%;
    background: #ffcd67;
    background-image: url(./images/bg-box-s1.gif);
    background-repeat: repeat-x
}

This code is in "Liferay in action" source.emoticon
images and css folder is inside your portlet folder
Your portlet
- css
- images
Bhaskar Koppuravuri, modificado 13 Anos atrás.

RE: How to add the CSS to our portlet?

New Member Postagens: 18 Data de Entrada: 19/01/11 Postagens Recentes
hi

while adding the css file iam getting this following error....

Current URL /web/guest/search.css generates exception: null



can any one help?
karthik reddy, modificado 10 Anos atrás.

RE: How to add the CSS to our portlet?

Junior Member Postagens: 60 Data de Entrada: 08/04/13 Postagens Recentes
http://javaeasyforu.blogspot.in/2014/02/how-to-include-css-or-js-or-image-file.html