0
votes

I have the following formatting on my horizontal WordPress menu. It works great.

.menu {
  width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 50;
  list-style: none;
}

In the footer of my theme I am trying to use a vertical menu through the WordPress menu setup. When I put the menu in the footer via a widget I get this:

<div class="menu-footer-container"><ul id="menu-footer" class="menu">

Because the UL class is menu it picks up the above horizontal css and makes the menu horizontal in my footer. How do I add CSS to make the menu vertical in my WordPress footer?

3
A result of this can help us to find a solution for you. - m4n0
@user1609391 if my answer helped you please consider marking my answer as correct :) - Chun

3 Answers

0
votes
<ul id="menu-footer" class="menu-ver">

You can use a different class for example menu-ver having following CSS,

.menu-ver {
  width: 200px;
  margin: 0 auto;
  position: relative;
  z-index: 50;
  list-style: none;
}
.menu-ver li{
  width: 100%;
}

Also you can adjust the margin property according to your design if you don't want it to get centered.

0
votes
.menu-footer-container .menu li {
    display: inline;
}

Use this code and it will work nicely. Thanks

0
votes

I don't think the problem it's on the .menu class, I'm assuming the problem it's in a CSS style for your li tags somewhere on your stylesheet.

It should look something like this: .menu li {display:inline-block;}. You can fix this by giving a style only for the li tags for your footer like this:

#menu-footer li {
    display: list-item;
}

Check out this online example on jsFiddle


Anyways if you still wanna style the .menu class just for the footer, you can do it like this:

.menu-footer-container .menu { ... } or simply style #menu-footer { ... } with the desired results.