Q:

Last child background color

I'm using this Wordpress theme which is build on Bootstrap 3 and I want the last child of the menu to have a different background.
I've tried:
.nav > li:last-child > a {
  background: red; 
  padding-right: 0 !important;
}

Here's the theme https://li.wordpress.org/themes/indreams/ and code:
<nav id="site-navigation" class="main-navigation text-center" role="navigation">
                            <div id="primary-menu" class="menu"><ul>
<li class="page_item page-item-2"><a href="https://wp-themes.com/?page_id=2">About</a></li>
<li class="page_item page-item-46 page_item_has_children"><a href="https://wp-themes.com/?page_id=46">Parent Page</a>
<ul class="children">
    <li class="page_item page-item-49"><a href="https://wp-themes.com/?page_id=49">Sub-page</a></li>
</ul>
</li>
</ul></div>
                        </nav>

Found it:
.main-navigation li:last-child{
    background: red!important;
}

Thanks

A:

You can try this. Because nav is tag not class so u dont need the DOT before nav
nav ul > li:last-child > a {
  background: red; 
  padding-right: 0 !important;
}

Or you can see this reference https://codepen.io/jasbir038/pen/VQrxEe

