CSS not loading for subpages css()

Good Morning!

Been trying to get the styles to work with my Kirby Installation.
My styles are being loaded when using:

echo css(../css/style.css)

Since I have subpages which are located in the content folder like.

---- content
----- home
--------home.de.txt
--------home.en.txt
------about
--------team.de.txt
------------ team.de.txt
------------ team.en.txt

My styles are not loaded i.e. when viewing page “team” due to the path not being “…css” instead of “de/css”

How can I load these right? I have tried:

<?php echo ->kirby()->urls()->assets() . '/css/style.css' ; ?>

Which does not work. Help would be much appreciated! Thank you in advance!

Hey! The best way is via the css helper, but with the complete path:

<?= css('assets/css/style.css') ?>

This will create the absolute URL to the stylesheet so that it works everywhere.

1 Like

Thank you so much! Made my day!