- This topic has 11 replies, 5 voices, and was last updated 5 years, 4 months ago by
Leo.
-
AuthorPosts
-
January 8, 2015 at 10:43 am #62862
Roy Shimmyo
First off, thank you, Tom for a great line of products, and excellent support.
I hope this is something that is ok to ask here. I’m not experiencing any defect or problem, I’m just trying to customize my site beyond the standard customization. I’m trying to change the background color for a single item in my navigation using custom CSS, but I’m not getting the syntax correct.
January 8, 2015 at 11:01 am #62869Tom
Lead DeveloperLead DeveloperHi Roy,
You’re welcome π
If you inspect element (using Chrome), you’ll see each menu item has a unique ID.
So, the syntax would be:
.main-navigation .main-nav ul li#menu-item-xx a { /* background and color stuff in here */ }
In the above, you would replace
menu-item-xx
with the ID of the menu item.Hope this helps π
January 8, 2015 at 11:05 am #62870Roy Shimmyo
Thanks Tom! This did the trick.
January 8, 2015 at 11:17 am #62873Tom
Lead DeveloperLead DeveloperAwesome π
March 1, 2015 at 2:36 pm #81649Pieter VAN OPSTAL
Hi Tom, thanks for your great work, I want to ad a personnel color to each of my main menu buttons in the main navigation menu. I tried the solution mentioned above, but i couldn’t find “menu-item-xx” while inspecting with chrome, i only find li class=”page_item page-item-xx”. I added the code mentioned above into the CSS, but I’m not able to make it work. You can take a look on http://www.arentat.info/wp
Thanks a lot, i’m pretty sure you will know how to deal with this π
March 1, 2015 at 11:47 pm #81766Tom
Lead DeveloperLead DeveloperDoesn’t look like you’re using GeneratePress?
Each menu item’s
<li>
element should have an ID like this:menu-item-xxx
March 2, 2015 at 1:16 am #81778Pieter VAN OPSTAL
Hi Tom,
I’m using Generatepress with the Mantle Theme, please take a look on http://www.argentat.info/wp
March 2, 2015 at 1:46 pm #81944Tom
Lead DeveloperLead DeveloperAh, have you created a menu and set a theme location in “Appearance > Menus”?
March 4, 2015 at 1:26 pm #82629Pieter VAN OPSTAL
I figured it out by following your tip (creating a menu), while inspecting the elements i found the lines you where talking about. I’ll work on it this weekend. Just another little question. is it possible to put space between the menu buttons, or to share all the buttons over the content width (with spacing between each button).
March 4, 2015 at 5:06 pm #82672Tom
Lead DeveloperLead DeveloperThere’s no way to make the items take up the entire space of the navigation area (that I know of), but you can adjust the left and right padding of the items using the Spacing add-on.
May 17, 2018 at 1:44 pm #578345ASCELCRE
Hi, I want to do it too, but my css is not working. I am failing in something:
.main-navigation .main-nav ul li#menu-item li#menu-item-type-post_type li#menu-item-object-page li#current-menu-item li#page_item li#page-item-1073 li#current_page_item li#menu-item-1078 a {
color: #FF0000; backgroung: #FF0000;
}Do yo know what is wrong?
May 17, 2018 at 2:33 pm #578369Leo
StaffCustomer SupportI would recommend the method in this article first:
https://docs.generatepress.com/article/adding-buttons-navigation/If not any chance you can open a new topic and link us to your site?
Thanks!
-
AuthorPosts
- You must be logged in to reply to this topic.