Is there a way to lock the header at a fixed distance from the edge of a phpbb2 forum? I need a way to keep the logo and navigation bar at a certain distance from the left side of the page but without the forum body being affected.
5 posters
Locking The Header
SLGray- Administrator
- Posts : 51554
Reputation : 3524
Language : English
Location : United States
- Post n°2
Re: Locking The Header
Please post your forum's link.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Draxion- Helper
- Posts : 2518
Reputation : 321
Language : English
Location : USA
- Post n°3
Re: Locking The Header
SLGray wrote:Please post your forum's link.
There's really no point in asking since they refuse to give it every time.
Using margin, @Zeta, can force an element to remain a distance away from another element. Try this.
- Code:
.headerbar {
margin-left: 20px;
}
You can change the "20px" to whatever number you wish. The higher the value, the more distance there is between.
Zeta- Forumember
- Posts : 211
Reputation : 2
Language : English
- Post n°4
Re: Locking The Header
That doesn't seem to be doing anything at all. Nothing I try to apply to ".headerbar" seems to do anything. I've tried "position: absolute" on the logo itself with the distance from set from top and left but then the logo ends up overlapping the forum so that's not an option either. I can use "position: absolute" the same way for "td.bodyline" and that does lock the logo and navigation bar so it is an option at least, but that also affects the forum itself, which I would prefer to avoid. So I still need a better solution than just locking the whole thing.Draxion wrote:SLGray wrote:Please post your forum's link.
There's really no point in asking since they refuse to give it every time.
Using margin, @Zeta, can force an element to remain a distance away from another element. Try this.
- Code:
.headerbar {
margin-left: 20px;
}
You can change the "20px" to whatever number you wish. The higher the value, the more distance there is between.
SLGray- Administrator
- Posts : 51554
Reputation : 3524
Language : English
Location : United States
- Post n°5
Re: Locking The Header
Do you mean the header or just the banner/logo?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Zeta- Forumember
- Posts : 211
Reputation : 2
Language : English
- Post n°6
Re: Locking The Header
I'd like to lock the entire header. The logo and the navigation bar and nothing below that.SLGray wrote:Do you mean the header or just the banner/logo?
TheCrow- Manager
- Posts : 6916
Reputation : 795
Language : Greek, English
- Post n°7
Re: Locking The Header
@Zeta, if you want them to be visible at all times, you should try
as this will keep the headerbar always shown no matter the scrolling a user does. Otherwise, if it's only for changing the left and right margin you should try this:
To change your header and your navigation bar you have to change these two elements:
These codes are only codes for #phpbb2 forums.
Regards.
|
- Code:
table[width="100%"]:first-child, table:nth-child(2) {
margin-right: 10px;
margin-left: 10px;
}
To change your header and your navigation bar you have to change these two elements:
affects your header containing the logo and- Code:
table[width="100%"]:first-child { ... }
affects your navigation bar only- Code:
table:nth-child(2) { ... }
These codes are only codes for #phpbb2 forums.
Regards.
 Forum of the Forums Forumotion Rules | Tips & Tricks | FAQ | Did you forget your password? |
*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
Zeta- Forumember
- Posts : 211
Reputation : 2
Language : English
- Post n°8
Re: Locking The Header
TheCrow wrote:@Zeta, if you want them to be visible at all times, you should tryas this will keep the headerbar always shown no matter the scrolling a user does. Otherwise, if it's only for changing the left and right margin you should try this:
- Code:
position: fixed;
- Code:
table[width="100%"]:first-child, table:nth-child(2) {
margin-right: 10px;
margin-left: 10px;
}
To change your header and your navigation bar you have to change these two elements:
affects your header containing the logo and
- Code:
table[width="100%"]:first-child { ... }
affects your navigation bar only
- Code:
table:nth-child(2) { ... }
These codes are only codes for #phpbb2 forums.
Regards.
I don't want to logo and navigation bar constantly on screen and overlapping the forum while scrolling like it would with "position: fixed", so "position: absolute" is the one to go with between those two.
That code did a lot more than just move the header and navigation bar. It sent my forum all over the place. Literally. Everything moved and things were overlapping and the wrong width. Changing the px values just made it worse and by the time I got the logo where it needed the be the rest of the page was a complete mess. It was startling and a little unsettling.
I assume that's not supposed to happen?
Ape- Administrator
- Posts : 19435
Reputation : 2010
Language : fluent in dork / mumbojumbo & English haha
- Post n°9
Re: Locking The Header
This is the problem when we can't see your forum to work on the codes for you.
I know you will not give your address so i will not ask for it.
I know you will not give your address so i will not ask for it.
TheCrow- Manager
- Posts : 6916
Reputation : 795
Language : Greek, English
- Post n°10
Re: Locking The Header
TheCrow wrote:@Zeta, if you want them to be visible at all times, you should try position: fixed; as this will keep the headerbar always shown no matter the scrolling a user does. Otherwise, if it's only for changing the left and right margin you should try this:
- Code:
table[width="100%"]:first-child, table:nth-child(2) {
margin-right: 10px;
margin-left: 10px;
}
In my suggestion for your fix above I never said that
|
|
|
|
Regards.
Zeta- Forumember
- Posts : 211
Reputation : 2
Language : English
- Post n°11
Re: Locking The Header
I never said that you said thatTheCrow wrote:TheCrow wrote:@Zeta, if you want them to be visible at all times, you should try position: fixed; as this will keep the headerbar always shown no matter the scrolling a user does. Otherwise, if it's only for changing the left and right margin you should try this:
- Code:
table[width="100%"]:first-child, table:nth-child(2) {
margin-right: 10px;
margin-left: 10px;
}
In my suggestion for your fix above I never said thatwill fix your issue. The only thing I suggested is that if you want the logo and the navigation bar constantly on the screen to use
- Code:
position: absolute;
otherwise, only the code provided above without any positioning will work. If not try applying
- Code:
position: fixed;
to the end of each line as below:
- Code:
!important
- Code:
margin-left: 10px!important;
Regards.
- Code:
position: absolute
- Code:
position: fixed
- Code:
position: absolute
I added the
- Code:
!important
TheCrow- Manager
- Posts : 6916
Reputation : 795
Language : Greek, English
- Post n°12
Re: Locking The Header
@Zeta, does your header only contain the logo or text also?
If it doesn't contain anything else other than your logo (banner), then you can try this:
Add this javascript:
and then add this CSS:
This should only change your logo and the navigation bar to your forum.
Regards.
If it doesn't contain anything else other than your logo (banner), then you can try this:
Add this javascript:
- Code:
$(function(){
$('a.mainmenu').closest('table').addClass('change');
});
and then add this CSS:
- Code:
table.change, #i_logo {
margin-left: 10px;
margin-right: 10px;
}
This should only change your logo and the navigation bar to your forum.
Regards.
 Forum of the Forums Forumotion Rules | Tips & Tricks | FAQ | Did you forget your password? |
*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
Zeta- Forumember
- Posts : 211
Reputation : 2
Language : English
- Post n°13
Re: Locking The Header
The reason I'm asking about this is because without any coding the logo and navigation bar want to shift further to the right or left on certain pages,like moving too far to the right on the login page or a little to the left when viewing a thread. This code isn't stopping that from happening.TheCrow wrote:@Zeta, does your header only contain the logo or text also?
If it doesn't contain anything else other than your logo (banner), then you can try this:
Add this javascript:
- Code:
$(function(){
$('a.mainmenu').closest('table').addClass('change');
});
and then add this CSS:
- Code:
table.change, #i_logo {
margin-left: 10px;
margin-right: 10px;
}
This should only change your logo and the navigation bar to your forum.
Regards.
SLGray- Administrator
- Posts : 51554
Reputation : 3524
Language : English
Location : United States
- Post n°14
Re: Locking The Header
Is this an issue on all devices and browsers?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Zeta- Forumember
- Posts : 211
Reputation : 2
Language : English
- Post n°15
Re: Locking The Header
All of the ones I have, at least. I can't speak for ones I don't have.SLGray wrote:Is this an issue on all devices and browsers?