Support » Themes and Templates » How to remove inner style from wp_nav_menu?

  • Resolved RealSouthpaw


    I’ve been working with this yesterday but now I have to admit I’m stuck.

    I want my navigations margin-top to be 0px but somewhere it still gets the idea that margin-top is 16.5px and I don’t get where that comes. In my css there is no such number but still when I check it with firefox the source says that there is kind of inner style or something which comes out like this:

    <ul id="menu-menu class="menu" style="margin-top: 16.5px;" >

    And the navigation is done with this line here:

    <?php wp_nav_menu( array( 'theme_location' => 'header', 'container' => 'ul') ); ?>

    I even checked out every file from original theme but I didn’t notice anything which would cause that inner style. So any ideas how can I fix this? Is it some kind of default style of wordpress or what?

Viewing 5 replies - 1 through 5 (of 5 total)
  • If you could post the link to your site that would be helpful for offering any advice…thx

    Siobhan Bamber (siobhyb)


    Automattic Happiness Engineer


    Could you please post a URL to the site that you’re referring to so we can view the source code? As you’re using a premium theme, we are unable to download that theme locally without paying.

    Have you already set up your child theme?

    NOTE. For commercial themes or plugins, we would usually direct you back to that specific vendor’s official support channel. However, Shaken Grid does not offer any official support.
    Here is the link.

    Another strange thing I noticed just now is that inner style shows up just when checking element with firefox own web console thing. When looking the actual source code everything seems to be ok. And yes, I’ve set up my child theme.

    Hi, i noticed inline margin being attached to other elements also besides navigation.
    I think the margin is being attached to every element due to a jquery code somewhere
    You can use !important to override margin but its not ideal solution.
    You need to find that code due to which inline margin is being generated.

    Went through every javascript I have here and found just one line, which lowered the number from 16,5 to 11,5px. After that I went one more time through every file in theme but couldn’t find any line which would cause the inline element at navigation. So solved this with that !important and it’s working now.

    Thanks for the help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to remove inner style from wp_nav_menu?’ is closed to new replies.