Why does not work :last-child ?
.group-list .user-name { border-bottom: 1px solid #e2e2e2; } .group-list .user-name:last-child { border-bottom: none; } .found-item { background: #fff; margin: 5px; padding: 5px 0; border-bottom: 1px solid #b6b6ba; } .found-item a { border-bottom: none; } .found-item a:hover { border-bottom: 1px solid #e8440d; } .found-item .user-name { padding: 5px 20px; } .found-item .user-name:hover { background: #e6e5e9; } .found-item .user-group { padding: 0 20px; } .found-item .icon-group { background-position: -13px -1215px; width: 14px; height: 14px; display: inline-block; } .group-title { text-transform: uppercase; font-weight: 600; font-size: 12px; padding-left: 25px; margin-top: 25px; } .group-list .user-name { border-bottom: 1px solid #e2e2e2; } .group-list .user-name:last-child { border-bottom: none; } <div class="group-list found-item"> <a href=""> <div class="user-name"> <b>Π’Π΅ΠΏΠ»ΠΎΠ² ΠΠ»Π΅ΠΊΡΠ΅ΠΉ</b> <span class="pull-right"><span class="icons icon-phone"></span> 25-354</span> <div>ΡΡΠΊΠΎΠ²ΠΎΠ΄ΠΈΡΠ΅Π»Ρ Π³ΡΡΠΏΠΏΡ</div> </div> </a> <a href=""> <div class="user-name"> <b>Π’Π΅ΠΏΠ»ΠΈΡΠ΅Π² ΠΠ°Π΄ΠΈΠΌ</b> <span class="pull-right"><span class="icons icon-phone"></span> 25-354</span> <div>ΠΈΠ½ΠΆΠ΅Π½Π΅Ρ</div> </div> </a> <a href=""> <div class="user-name"> <b>Π’Π΅ΠΏΠ»Π°Π²ΠΈΠ½Π° ΠΠ²Π³Π΅Π½ΠΈΡ</b> <span class="pull-right"><span class="icons icon-phone"></span> 25-354</span> <div>ΠΈΠ½ΠΆΠ΅Π½Π΅Ρ</div> </div> </a> </div> Each element except the last one needs a border-bottom . When adding last-child border is for some reason removed from all elements.
UPD
In this case, link styles do not affect the display. They set their own text-decoration: none; style text-decoration: none;
UPD 1.0
All divs with the class .user-name given the style - border-bottom: 1px solid #e2e2e2; .
The essence of the question - the last diva with the class .user-name remove the border-bottom
PS: All the divs with the class .user-name are inside the diva with the class .group-list .
UPD 1.1
When I add the border-bottom style, I use only divas with the .user-name class .user-name what's inside them doesn't matter (we donβt .user-name to them).
usernamedash from theusernameclass. 2).grouplist a .username { ... }style 3) Why set the border, and then remove it? - Mr. Blackhrefattribute in the<a>tag) text is underlined, and not because of theborder-bottom- Mr. Blackborder-bottomand in this part, links have no underscore at all. - Marina Voronovalast-child? - Marina Voronovaborder, but throughtext-decoration: none;or if underlines are neededtext-decoration: underline;- Mr. Black