Exclusion through php and problems with :last-child
<div class="katalog"> <p>Каталог</p> <ul> <?php foreach($products as $product): ?> <a href="#"><li><?=$product['name']?></li></a> <?php endforeach;?> </ul> </div> <!-- /katalog -->
For each element of li, the Borders of the Upper and Lower Border First and Last must be removed, respectively. Through :last-child and :first-child doesn't work out why. Help who can! Thank you in advance!
Since there are no details and examples of the code, I'm guessing that the problem is in the vain verb:
liAs a subsidiary, and you have it there.
a♪ That's why.
:first-childYou apply to each.
li- They don't have a wedding at the same level of investment, which is why each part of the list is both final and first.
You can replace the correct structure if it suits you:
<div class="сatalog"> <p>Каталог</p> <ul> <?php foreach($products as $product): ?> <li><a href="#"><?=$product['name']?></a></li> <?php endforeach;?> </ul> </div>
Either you change thelt and choose the elements.
a:first-childBecause they're daughters for you.
uland at one level of investment. But consider that the references might be somewhere else, so the selter needs to be specific (to get a new one.
<ul class="list"> ... </ul>