The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
3 posters

    Centered sticky navbar

    Lady Loki
    Lady Loki
    Forumember


    Female Posts : 28
    Reputation : 2
    Language : English, Spanish

    Solved Centered sticky navbar

    Post by Lady Loki November 21st 2018, 6:41 am

    Hi, it's me bothering again.
    I'm using this code (https://help.forumotion.com/t143777-make-your-navbar-sticky#981208) to make my navbar sticky and I want to center it. However, every time I try to add a margin:auto or something, it does nothing. How can I center the navbar?
    Here is my forum:


    Last edited by Lady Loki on November 22nd 2018, 12:58 am; edited 1 time in total
    skouliki
    skouliki
    Manager
    Manager


    Female Posts : 15391
    Reputation : 1709
    Language : English,Greek
    Location : Greece

    Solved Re: Centered sticky navbar

    Post by skouliki November 21st 2018, 8:15 am

    hello

    try this

    Code:

    #fa_sticky_nav {
        margin-right: 270px;
    }

    Draxion
    Draxion
    Helper
    Helper


    Male Posts : 2518
    Reputation : 321
    Language : English
    Location : USA

    Solved Re: Centered sticky navbar

    Post by Draxion November 21st 2018, 8:20 am

    Hi there, are you saying you want it centered and fill the entire header space or leave the width as it is but center the navbar?
    Lady Loki
    Lady Loki
    Forumember


    Female Posts : 28
    Reputation : 2
    Language : English, Spanish

    Solved Re: Centered sticky navbar

    Post by Lady Loki November 21st 2018, 9:23 am

    skouliki wrote:hello

    try this

    Code:

    #fa_sticky_nav {
        margin-right: 270px;
    }

    Hi, thank you. Although it moves the navbar, it doesn't look centered and while I can adjust it to fix my screen I don't think it'll be right in other resolutions Crying or Very sad

    Draxion wrote:Hi there, are you saying you want it centered and fill the entire header space or leave the width as it is but center the navbar?

    Hi. I want to leave the width as it is and center the navbar
    Draxion
    Draxion
    Helper
    Helper


    Male Posts : 2518
    Reputation : 321
    Language : English
    Location : USA

    Solved Re: Centered sticky navbar

    Post by Draxion November 21st 2018, 9:29 am

    You can use this.

    Code:

    #fa_sticky_nav {
      width: 75%;
      left: 50%;
      margin-left: -37.5%;
    }
    Lady Loki
    Lady Loki
    Forumember


    Female Posts : 28
    Reputation : 2
    Language : English, Spanish

    Solved Re: Centered sticky navbar

    Post by Lady Loki November 22nd 2018, 12:58 am

    I hadn't thought about using percentages. Thank you so much!
    Draxion
    Draxion
    Helper
    Helper


    Male Posts : 2518
    Reputation : 321
    Language : English
    Location : USA

    Solved Re: Centered sticky navbar

    Post by Draxion November 22nd 2018, 1:41 am

    You're very welcome.

    Problem solved & topic archived.
    Please read our forum rules: ESF General Rules

      Current date/time is November 11th 2024, 6:52 pm