Page 1 of 1

Load module CSS after template CSS using addStyleShees

Posted: Mon Feb 04, 2013 8:53 pm
by tpelek
Hello,
I use the following code in custom module

Code: Select all

$document =& JFactory::getDocument();
$document->addStyleShees
to load CSS in head.

The problem is that the CSS goes first in head and before template CSS,
so became override by template CSS.

There is any way to add this CSS at the end of head or after templates CSS ?

Thanks in advance

Re: Load module CSS after template CSS using addStyleShees

Posted: Wed Feb 06, 2013 10:29 am
by oleolson
Haven't a solution directly but you can try to add

!important

to your styles you want to override with your module css. Example:

Code: Select all

.theOverrideClass {
color: #FFF !important;
}

Re: Load module CSS after template CSS using addStyleShees

Posted: Thu Feb 07, 2013 8:59 am
by tpelek
I was wondering if there is any solution to add the css to the end of the head.

thanks anyway.

Re: Load module CSS after template CSS using addStyleShees

Posted: Mon Nov 13, 2017 1:46 pm
by Webdongle
Are you adding the template.css like

Code: Select all

// Add Stylesheets
JHtml::_('stylesheet', 'template.css', array('version' => 'auto', 'relative' => true));