Hi. I am trying to make cards for my articles. If I apply some css code to it, the background-color code is not applyed only to one article but to whole block.
So I want to achieve this →
But this happens when I try to add some styling →
<main class="articolelepulii" role="main">
<?php foreach($page->children()->listed()->flip()->paginate(9) as $article): ?>
<article>
<div class="cards">
<h2><?= $article->title()->html() ?></h2>
<p><?= $article->text()->excerpt(300) ?></p>
<?= $article->intro()->kirbytext() ?>
<a href="<?= $article->url() ?>">Read more…</a>
</div>
</article>
<?php endforeach ?>
</main>