Center navbar links without messing up the drop down
-
My problem is that I can’t make the links centered in my navbar without making my dropdown menu move too. I’ll keep it that way for now so that you guys can se the problem: http://frokenfri.nu/
It’s where I have: “kategorier”
And I also want “kategorier” (categories) not to be clickable in the navbar. I just want people to be able to hover over it and see my categories.
Can you guys help please? <3
-
Look at the direct child selector https://developer.mozilla.org/en-US/docs/Web/CSS/Child_selectors
I’m sorrry but I don’t get it :<
How familiar are you with CSS?
Not at all, I’ve just been playing around on my site. It’s confusing since I used HTML a couple of years ago and now I’m all lost :c
How did you center the nav bar, was that through a setting in the dashboard?
I changed in the style.css so it looks like this:
.nav ul {margin-left: 220px; list-style: none; max-width: 780px; display: inline-block;} .nav a {text-align: center; display: block; padding: 14px; color: #fff;} .nav a:hover {text-decoration: underline; color: #fff;} .nav ul ul a {display: block; padding: 14px; position: relative;}
So it’s the nav.ul that doesn’t like me ;b
I think both the drop down and the navlinks go under the same code but I don’t know how to fix it :/If you’re not using a Child Theme, and if the theme doesn’t have a designated section of the dashboard for CSS modifications then install this Custom CSS Manager plugin http://wordpress.org/plugins/custom-css-manager-plugin
Then use its “CSS Code” section of the dashboard to hold your CSS modifications:
Alternatively use your Child Theme style.css file to hold your CSS modifications:
.nav > ul > li a { text-align: center; }
Thank you! I’ll try the plugin π
I tried to copy-paste your code into the Custom CSS Manager Plugin Settings but it doesn’t help :c
I fixed it with this:
.nav ul { margin-left: 200px; } .nav ul ul { margin-left: 0px; }
THANK YOU <3
But now I only have the problem with my caregories-page. I don’t want that link to be clickable.. I just want the drop down to be xD
Was that caused by centering your navigation menu, or is this a different issue?
It’s a different issue, should I make another post about it?
- The topic ‘Center navbar links without messing up the drop down’ is closed to new replies.