It is required that the background defined by the class active apply only to the first line of the list item <li> containing another list, and in other cases it is processed by default (as defined in the standard):
.active { background-color: yellow; color: blue; border: 1px solid black; } <ul> <li class="active">sub li1 <ul> <li>child1</li> <li>child2</li> <li class="active">child3</li> </ul> </li> <li>sub li2 <ul> <li>child1</li> <li>child2</li> <li class="active">child3</li> </ul> </li> </ul> 
li .active:before {content: '•'; background: yellow;}li .active:before {content: '•'; background: yellow;}- Mr. Black