I'm trying to set the left border of the list item with Link
text to red on active, and when the user clicks another list item, the previous border is set to the original and the successive list item is then set to a red left border. I tried with an :active
class, but that is not working correctly:
<ul class="list-group">
<li class="2" data-toggle="collapse" data-target="#2" aria-expanded="false">Link</li>
</ul>
CSS
li {
list-style-type: none;
}
.list-group li:active {
border-left: 3px solid #ce2523;
padding-left: 7px;
color: #000000;
}
JSFIDDLE: LINK
` is `- - not `
`. I'd suggest putting your `` in an `- ` and straightening out any HTML issues before moving on to addressing CSS
– Tyler Roper Apr 14 '17 at 21:16