Catsmother
Active member
I am making a style and I can't find where to adjust the width of the Navigation bars.
Is there a way of doing this please?
Is there a way of doing this please?
.p-nav .p-nav-inner, .p-sectionLinks .p-sectionLinks-inner {
max-width: 1500px;
}
Thank youThe width of the navigation inherits from: Style properties -> Page setup -> Maximum page width. If you increase the value here it'll increase the overall page width of the entire site.
If you want to just increase the navigation, you can add something like this to your extra.less template:
Code:.p-nav .p-nav-inner, .p-sectionLinks .p-sectionLinks-inner { max-width: 1500px; }
It hasn't worked.Just use a smaller value than 1500. Out of the box, XF2 is 1200.
Thanks, I did what you said and all it did was move the text. I want the nav tree the same size as the forums.Any CSS you receive on these forums should go inside the template extra.less normally. Go to appearance -> templates -> extra.less and place the code there.
Thanks that has worked. Just one more question though it did not do anything to the second row on the navigation. the row where new posts are etc.Try this in style properties > Header and Navigation > Navigation row > freeform CSS
Code:max-width:1000px; margin:auto;
Use what width you want
Or
in extra.less
Code:.p-nav {max-width:1000px; margin:auto}
They don't seem to work in Freeform.extra css
Code:.p-sectionLinks {max-width:1000px; margin-auto}
Or same with Style properties but sub navigation row freeform CSS
Code:max-width:1000px; margin-auto;
Works fine for me on default styleThey don't seem to work in Freeform.
Tried the sub nav in extra.less and it doesn't work.
Yeah this is what I am trying to doIs this what you are trying to achieve?
View attachment 234670
If so, it's done by setting.p-sectionLinks-inner
to 964px. and.p-nav
to 960px. I also moved the background color from.p-sectionLinks
to.p-sectionLinks-list
.
Didn't realise that, thank you.Well, the
Works fine for me on default style
Yeah this is what I am trying to doThank you!
Do I need to go in the templates to do that? and if so what area?
.p-sectionLinks-inner
{
max-width: 964px;
margin: 0 auto;
}
.p-nav
{
max-width: 960px;
margin: 0 auto;
}
.p-sectionLinks
{
background: none;
}
.p-sectionLinks-list
{
background: #f5f5f5;
}
!important
is not required. The #f5f5f5 color I used is just an example, replace with your own, <nav class="p-nav">
and replace with <nav class="p-navSticky p-navSticky--primary p-nav" data-xf-init="sticky-header">
<div class="p-navSticky p-navSticky--primary" data-xf-init="sticky-header">
and replace with: <div class="p-navSticky">
Thank you so much for this, it workedAppearance -> Styles -> The name of the style you are editing -> Templates -> extra.less
HTML:.p-sectionLinks-inner { max-width: 964px; margin: 0 auto; } .p-nav { max-width: 960px; margin: 0 auto; } .p-sectionLinks { background: none; } .p-sectionLinks-list { background: #f5f5f5; }
The above works, and!important
is not required. The #f5f5f5 color I used is just an example, replace with your own,
To move the box-shadow that covers the width of your forum as you scroll down and the navigation becomes stuck to the new narrower nav bar, you will need to edit the PAGE_CONTAINER template for your style:
At approx. line 136 find<nav class="p-nav">
and replace with<nav class="p-navSticky p-navSticky--primary p-nav" data-xf-init="sticky-header">
Next at approx. line 382 find<div class="p-navSticky p-navSticky--primary" data-xf-init="sticky-header">
and replace with:<div class="p-navSticky">
<span class="p-nav-menuText">{{ phrase('menu') }}</span>
We use essential cookies to make this site work, and optional cookies to enhance your experience.