Becca
Junior Member
Utterly lost in graphics creation atm, brb!
Posts: 374
inherit
70046
0
Jun 25, 2023 9:52:55 GMT -8
Becca
Utterly lost in graphics creation atm, brb!
374
January 2006
beccagranger
|
Post by Becca on Mar 30, 2019 21:32:04 GMT -8
I was wondering if there was a template or snippet of css that I can put on a theme to center the menu instead of having it default to the left. I am not using any plugins and no menu buttons. This image shows what I'd like to do: I'm hoping it's an easy fix, but I have tried (in vain) to find where to change it in my style sheet. I just can't figure it out. Thank you in advance for any help.
|
|
inherit
96289
0
May 17, 2020 9:37:00 GMT -8
elli
1,822
January 2007
ebbymac
|
Post by elli on Mar 31, 2019 9:09:07 GMT -8
Sure, try this. - Go to Admin > Themes > Advanced Styles & CSS and click on the "Style Sheet" tab
- Find this line:
#navigation-menu > ul, #navigation-menu > ul li { float: left; }
- You'll need to separate these so that #navigation-menu > ul doesn't have float: left, like this:
#navigation-menu > ul { } #navigation-menu > ul li { float: left; }
- To #navigation-menu > ul, add the following:
#navigation-menu > ul { display: inline-block; vertical-align: top; }
- Next, find the following line:
#navigation-menu { padding: 0 8px; background: @nav_bar_background; border: @nav_bar_border; .rounded-corners(@nav_bar_border_radius); }
- Add text-align: center; to #navigation-menu:
#navigation-menu { padding: 0 8px; background: @nav_bar_background; border: @nav_bar_border; text-align: center; .rounded-corners(@nav_bar_border_radius); }
- Click "Save Theme" or "Save Changes" to save your changes.
Let me know if you have any issues.
|
|
Becca
Junior Member
Utterly lost in graphics creation atm, brb!
Posts: 374
inherit
70046
0
Jun 25, 2023 9:52:55 GMT -8
Becca
Utterly lost in graphics creation atm, brb!
374
January 2006
beccagranger
|
Post by Becca on Mar 31, 2019 11:10:48 GMT -8
Yay, it worked perfectly! Thank you so much, Elli, I appreciate your help.
|
|
inherit
252032
0
Apr 26, 2024 23:51:41 GMT -8
Retread
Tribbial Pursuit.
5,017
January 2018
retread
|
Post by Retread on Mar 31, 2019 11:27:18 GMT -8
My favorite part of this solution was this: You'll need to separate these so that #navigation-menu > ul doesn't have float: leftAs someone who's still learning CSS, you taking the time to explain the core issue was much appreciated!
|
|