Hi I have a problem with my CSS I have used this rule before but somehow it's not working this time
I am trying to make a list that has a border on the bottom of every list item but the last. I have the following code:
.menu li {
border-bottom: .1rem solid #CCC;
padding: 0;
}
.menu li:last-child {
border: none;
}
.menu li a,
.menu li div {
display: block;
padding: .5rem 0rem .5rem;
border-bottom: .1rem solid #ccc
}
<div class="panel">
{% comment %}
{% endcomment %}
<h1>All {{team.abbrev}} {% trans "Songs" %}</h1>
{% for chant in chants %}
{% with chant.team as team %}
<ul class="menu">
<li>
<span>
<h6 style="margin-bottom:0;">
<a href="{% url 'chant' team.slug chant.slug %}">{{ forloop.counter}}) {{ chant.name }}</a>
</h6>
</span>
</li>
</ul>
{% if forloop.counter == 5 %}
{% include 'inc/adsense_listing.html' %}
{% endif %}
{% endwith %}
{% endfor %}
</div>
<a>
,<div>
as well as<li>
. Thelast-child
is working just fine, but it is only set for the list item. – Kazmircia
anddiv
? While you are at it, you can remove all those HTML elements that don't seem needed:<span>
and<h6>
seem redundant here. Example here – Kazmirci