[Resolved] Want button inside mobile header centered.

Home Forums Support [Resolved] Want button inside mobile header centered.

Home Forums Support Want button inside mobile header centered.

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #1116461
    jorge

    Used this guide and was able to get button working, but isn’t centered – it is off to the right on my phone, was wondering if there’s css, or any setting to have it centered no matter the device.

    Thank you very much!

    #1116849
    jorge

    Any ideas? Thanks again, just bumping.

    #1116854
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Try this CSS:

    #mobile-header .mobile-bar-items {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
    }
    #1116859
    jorge

    That did it. Thank you very much, Tom!

    #1116868
    Tom
    Lead Developer
    Lead Developer

    You’re very welcome 🙂

    #1116869
    jorge

    Tom, it seems like the button text protrudes outside of the bar as in a small box. also when i scroll up , etc the placement of the button moves which looks odd.

    #1116870
    jorge

    I mean the button itself is outside of the bar as you scroll down.

    #1116871
    Tom
    Lead Developer
    Lead Developer

    Try adding this as well:

    #mobile-header .mobile-bar-items .button {
        padding-top: 0;
        padding-bottom: 0;
    }
    #1116872
    jorge

    Okay That removed the protrusion of the button. The button is not fixed as you scroll up it moves from one side to the other.

    #1116940
    jorge

    Is there anything i can do about the button moving as you scroll up and down? it doesn’t stay in a fixed spot.

    #1117117
    Tom
    Lead Developer
    Lead Developer
    #1117131
    jorge

    I did try that, what i’m saying is as i scroll up, and down – the button shifts position as i scroll up or down it does not stay in a fixe position.

    #1117133
    jorge

    Does not stay in a fixed position.

    #1117350
    David
    Staff
    Customer Support

    Hi there,

    remove this:

    #mobile-header .mobile-bar-items {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    and lets try this instead:

    #mobile-header .mobile-bar-items {
        margin-left: auto;
        margin-right: auto;
    }
    #mobile-header .menu-toggle {
        min-width: 60px;
    }
    .site-logo.mobile-header-logo {
        margin-right: unset;
    }
    #1117359
    jorge

    That worked great, thank you!

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.