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.

Centered sticky navbar

3 posters

Go down

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
Lady Loki
Lady Loki
Forumember

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

http://alternate-universe.foroactivo.mx

Back to top Go down

Solved Re: Centered sticky navbar

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

hello

try this

Code:

#fa_sticky_nav {
    margin-right: 270px;
}
skouliki
skouliki
Manager
Manager

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

http://iconskouliki.forumgreek.com

Back to top Go down

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?
Draxion
Draxion
Helper
Helper

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

https://www.talesoftellene.com/

Back to top Go down

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
Lady Loki
Lady Loki
Forumember

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

http://alternate-universe.foroactivo.mx

Back to top Go down

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%;
}
Draxion
Draxion
Helper
Helper

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

https://www.talesoftellene.com/

Back to top Go down

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!
Lady Loki
Lady Loki
Forumember

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

http://alternate-universe.foroactivo.mx

Back to top Go down

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
Draxion
Draxion
Helper
Helper

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

https://www.talesoftellene.com/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum