can you please take a look at this demo and let me know how I can apply CSS rules to all of an spesific Class .box
but NOT to the last one?
I already tried :not(:last-of-type)
and :not(:last-child)
but they are not doing the job
.box{
height:40px;
width:100%;
padding:12px;
}
.box:not(:last-of-type){
border-bottom: 1px solid #ddd;
}
.box:not(:last-child){
border-bottom: 1px solid #ddd;
}
<div class="box">Box 1</div>
<div class="box">Box 2</div>
<div class="box">Box 3</div>
<div class="box">Box 4</div>