• lala100

    (@lauren-and-joe)


    Hi,

    I recently built a child theme for my website. It looks good on a computer screen; however, when I look at it on an iphone, the menu items are skewed to the far right.

    Here’s a link to the site: https://www.GrimmAles.com

    Does anyone know how to alter the child theme so that the menu items are centered both on a computer and an iphone? Really, I just want the website to look the same on an iphone as it does on a computer screen.

    Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Override and remove all paddings, margins, widths and floats (may not have all of them) that make the menu centred like that.

    Then try something like;

    #access ul {
     display: table;
     margin: 0 auto;
    }

    Thread Starter lala100

    (@lauren-and-joe)

    Thanks Andrew!

    I’m not the best at css. I tried doing what you suggested, but it doesn’t seem to be working.

    Where should I add the code that you mention above?

    https://www.GrimmAles.com

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    There’s still a 200-ish pixel padding to the right of the menu’s container.

    Thread Starter lala100

    (@lauren-and-joe)

    Hmmm… I think that I might need more direction. Where would I find that paddding in order to change it?

    Here’s my style sheet:
    [No need to post stylesheet, you’ve already linked the website]

    Add this to your stylesheet:

    #branding .only-search + #access div {
        padding-right: 0px;
    }

    Are you using Firebug to work with CSS? It’s really a super tool and the only way to go, IMHO :)!

    Thread Starter lala100

    (@lauren-and-joe)

    Wow! Firebug looks awesome. Thanks for the tip.

    I added the code that you sent to my style sheet. It helped, but it’s not perfect. Now when I look at the website on an iphone, two of the menu items are on the same line, but the third is below. Any ideas?

    And, thank you so much for your help!

    Thread Starter lala100

    (@lauren-and-joe)

    Andrew,
    Sorry about posting on two forums. When I posted a question a few months ago, someone told me that I was posting in the wrong forum, so I was just trying to cover my bases. Won’t happen again. I didn’t realize that wasn’t allowed.
    Thanks for your help.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    There’s no need to apologise, we’re really forgiving ??

    Thanks for your contributions to the WordPress community.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘how to center menu items for iphone or mobile device’ is closed to new replies.