The first child

In order to target the first element in our CSS, we'll add first-child after the anchor element. So we'll copy this selector and paste it underneath itself:

.primary-nav > li > a {  float: left;  padding: 25px 0;  width: 150px;  border-left: 1px solid #ada791;}

We'll then add :first-child to the selector, delete the properties, and add border-left with the value set as none:

.primary-nav > li > a:first-child {  border-left: none;}

Save this, go to the site, and refresh the page:

The result isn't what we might have expected. We actually removed the left border from every item in our navigation. This is because, firstly, all the anchors ...

Get Mastering CSS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.