Archived topic
Adding a button in main navigation
5 replies · Started by Michaela on July 16, 2021
Hello,
I'm trying to add a button to main navigation. I followed the documentation article, added class .student-menu-item to my menu item and created this:
@media (min-width:769px) {
.main-navigation .main-nav ul li.student-menu-item a {
background-color: #1cc989;
border-radius: 3px;
color: #FFFFFF;
line-height: 35px;
font-weight: 600;
margin-left: 10px;
}
And it works for other items in my main navigation but not the one item that has sub menu items under it. It's the last one on the right called Student.
Can you please help?
Thank you.
Misa
Hi there,
try changing this line:
.main-navigation .main-nav ul li.student-menu-item a {
to:
.main-navigation .main-nav ul li.student_menu_item > a {
The CSS class you added has underscore _ not hyphen - :)
Well...thank you :) It raises another question. The sub menu items seem to inherit the styling. Is there a way around it? Or should I assign them classes and style them one by one?
Doh ... updated the line above - missed out the >
Nice, thanks :)
You're welcome