In wordpress template I have navigation meniu
<nav id="main-menu">
<?php
$home_url = home_url();
$menu = wp_nav_menu(array('theme_location' => 'main', 'menu_id' => 'menu', 'echo' => false,
'menu' => 'LT'));
$menu = str_replace('#HOME_URL', $home_url, $menu);
echo $menu;
?>
</nav>
I want that last of menu link will be red I try this
ul#main-menu li a:last-child{color: red;}
but it not work.
Assuming your structure is like that:
You have to use:
As you’re referring to the last
<li>-element.