Black Friday 2026 50% off every plan Our biggest deal of the year on #1 Joomla products.
Ends in 12d 05h 09m 29s
Claim 50% off
Solved Templates

Linking the CSS file last in the order

Asked by Tomas 4 years ago Last activity 4 years ago

Link the template.css file in the head tag last, after all others css files.

Accepted answer

Marked as the solution
Rashida Rahman Staff

Hi Tomas,

In general, if you put your custom CSS within the custom.css file it overrides existing styles as per my knowledge.

If something is not working then you need to be specific and deeper as much as opssible with your selectors. This should be enough to make your own style working.

Can you give me your site URL to check the ordering you mentioned?

Best Regards

8 more replies

Rashida Rahman Staff

Hi there!

Thanks for your query.

Would you please describe your issue a little bit more, kindly?

Do you want to load the template.css file at the last file?

Best Regards

Paul Frankowski Senior Staff

Hi Tomas,

So you have problem with using custom.css file, am I right?

What template name you have?

Tomas Asked this

I want to use main template.css or custom.css, which would be loaded at the end (last) in head tag, after all other linked css files. Because I need to override css properties from previous files and I want to avoid using !important.

I use helix ultimate 1.1.2.

I tried to move row $theme->addscss('master', $scssVars, 'template'); before </head> tag in index.php, but still many modules and plugins add css files after template.css.

All I need is to move template.css or custom.css lower, after all other linked css files.

Paul Frankowski Senior Staff

Please update template, we cannot support old template.
You should have Helix Ultimate 2.0.5

Otherwise you have to edit index.php from template to fix it.

Tomas Asked this

Reply to Paul > I can't update Helix template because the new version doesn't work with Advance Template Manager by Regular Labs. I'll update as soon as he cooperates with it. Or version 2.0.5 already works with Advance Template Manager?

Reply to Rashida > Yes, custom.css is the solution that suits me, but I don't know how to add it at the end, after all the other .css files. I have a problem with sorting.

I want something like this:

<link href="/module1.css" rel="stylesheet" />
<link href="/module2.css" rel="stylesheet" />
<link href="/module3.css" rel="stylesheet" />
<link href="/module4.css" rel="stylesheet" />
<link href="/CUSTOM.CSS" rel="stylesheet" />

Even if I load the custom.css in the index.php file right before the end of the head tag, the custom.css is not the last one.

$theme->add_css('custom.css');
?>
</head>
<body

Not like this:

<link href="/module1.css" rel="stylesheet" />
<link href="/module2.css" rel="stylesheet" />
<link href="/CUSTOM.CSS" rel="stylesheet" />
<link href="/module3.css" rel="stylesheet" />
<link href="/module4.css" rel="stylesheet" />
Tomas Asked this

I found a solution using Helix ultimate template settings and "Custom code" > "Before </head>" field.
If I load custom.css this way, the last css is loaded in the head tag. I was hoping that there is a better solution, because in this case I have to use an absolute address to the css file.

Best Regards.

Rashida Rahman Staff

Hi,

Thanks for sharing your experience with us.

Best Regards

Log in to reply.