I am trying to figure out how to write a style for the following:
I only want to style a:hover and a:active for the anchor tags inside .menu, not .menu-switch. The below appears to be working, but is there anyway I can join them into one style?
/*Apply the following styles to anchor tags within any ul within #main-nav*/
#main-nav ul li
a:link,
a:hover,
a:active,
a:visited {
color: #fff;
text-decoration: none;
padding: 10px;
display: block;
border-radius: 4px;
}
/*Apply the following styles to anchor tags within .menu only within #main-nav*/
#main-nav .menu a:active {
background-color: #ccc;
}
#main-nav .menu a:hover {
background-color: #ccc;
}
<div id="main-nav">
<ul class="menu-switch">
<li><a class="js-menu-toggle" href="#">OPEN ME</a></li>
</ul>
<ul class="menu">
<li><a href="#">Menu item 1</a></li>
<li><a href="#">Menu item 2</a></li>
</ul>
</div>