This CSS works with the following markup (reduced for simplicity):
<nav id="colorNav"> <ul> <li class="green"> <a href="#" class="icon-home"></a> <ul> <li><a href="#">Back to the tutorial</a></li> <li><a href="#">Get help</a></li> </ul> </li> <li class="red"> <a href="#" class="icon-cogs"></a> <ul> <li><a href="#">Payment</a></li> <li><a href="#">Notifications</a></li> </ul> </li> </ul> </nav>
The selector targets the :before pseudo-element on the internal li elements, which are also the first elements in the parent object:
#colorNav li ul li:first-child:before
Your code is missing here, but present in the source tutorial, there was the following comment:
This specific set of rules is designed to create a small triangle that appears at the top of the drop-down menu, pointing to the corresponding block (in the photo below, underlined by a red circle):

The following are the styles for creating a triangular shape:
content: none; position: absolute; width: 1px; height: 1px; border: 5px solid transparent; border-bottom-color: #313131; left: 50%; top: -10px; margin-left: -5px;
The end result is a triangle created exclusively with borders in CSS.
source share