Hi!
As you know, I’m new to Kirby, HTML, CSS and PHP. But I’m doing my homework. But sometimes I need your help…
I want to achieve, that the selected page is highlighted (mockup attached).
My header:
header-snippet
`
<title><?= $site->title() ?> | <?= $page->title() ?></title>
<?= css('assets/css/styles.css') ?>
</head>
<body>
<header class="header-nav">
<a href="<?= $site->url() ?>"><img src="assets/img/logo.png" alt="Das Logo dieser Webseite."></a>
<nav>
<?php foreach ($site->children()->listed() as $subpage): ?>
<a href="<?= $subpage->url() ?>">
<?= $subpage->title() ?>
</a>
<?php endforeach ?>
</nav>
</header>
`
This is my CSS-Snippet…
CSS-Snippet
.active {
background-color: #A62C21;
}
…when I include that to my header-snipped in the a-brackets, I’ll get all my navigation-URLs in red. But I just want to set that active one to red. How can I do that?
Thank you in advance.