I'm struggling to eliminate the border-right property of the last tab, but neither the nth-child property nor the last-child property is working. Additionally, when I use nth-child(1), it selects all the children and doesn't apply to other values.
<!-- HTML Markup -->
<ul>
<a href="#">
<li>Solutions</li>
</a>
<a href="#">
<li>Industries</li>
</a>
<a href="#">
<li>Resources</li>
</a>
<a href="#">
<li>Partners</li>
</a>
<a href="#">
<li>About</li>
</a>
<a href="#" class="button">
<li>Enterprise</li>
</a>
</ul>
/* CSS Code */
ul:after{
content: "";
display: block;
clear: both;
}
li {
float: left;
padding: 10px 15px;
/* border-right: 1px solid #a5a5a5; */
color: #1F222B;
}
li {
border-right: 1px solid #ff0000;
}
li:nth-of-type(1) {
border-right: 1px solid #00b2ff;
}
li:hover {
border-right: 1px solid #F3EFF2;
background: #1F222B;
color: #F3EFF2;
}
Could someone please provide a solution and explain why this issue is happening? And is there a way to address it with 'li' tags within the 'a' tag while using floating 'li' tags?