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
5 posters

    Locking The Header

    Zeta
    Zeta
    Forumember


    Posts : 211
    Reputation : 2
    Language : English

    In progress Locking The Header

    Post by Zeta May 8th 2019, 9:13 am

    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.
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51554
    Reputation : 3524
    Language : English
    Location : United States

    In progress Re: Locking The Header

    Post by SLGray May 8th 2019, 8:28 pm

    Please post your forum's link.



    Locking The Header Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    Draxion
    Draxion
    Helper
    Helper


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

    In progress Re: Locking The Header

    Post by Draxion May 8th 2019, 10:54 pm

    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
    Zeta
    Forumember


    Posts : 211
    Reputation : 2
    Language : English

    In progress Re: Locking The Header

    Post by Zeta May 9th 2019, 2:41 am

    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.
    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.
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51554
    Reputation : 3524
    Language : English
    Location : United States

    In progress Re: Locking The Header

    Post by SLGray May 9th 2019, 2:54 am

    Do you mean the header or just the banner/logo?



    Locking The Header Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    Zeta
    Zeta
    Forumember


    Posts : 211
    Reputation : 2
    Language : English

    In progress Re: Locking The Header

    Post by Zeta May 9th 2019, 4:34 am

    SLGray wrote:Do you mean the header or just the banner/logo?
    I'd like to lock the entire header. The logo and the navigation bar and nothing below that.
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    In progress Re: Locking The Header

    Post by TheCrow May 9th 2019, 7:46 am

    @Zeta, if you want them to be visible at all times, you should try
    Code:
    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;
    }

    To change your header and your navigation bar you have to change these two elements:
    • Code:
      table[width="100%"]:first-child { ... }
      affects your header containing the logo and
    • Code:
      table:nth-child(2) { ... }
      affects your navigation bar only


    These codes are only codes for #phpbb2 forums.

    Regards.



    Locking The Header Thecro10
     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
    Zeta
    Forumember


    Posts : 211
    Reputation : 2
    Language : English

    In progress Re: Locking The Header

    Post by Zeta May 9th 2019, 8:29 am

    TheCrow wrote:@Zeta, if you want them to be visible at all times, you should try
    Code:
    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;
    }

    To change your header and your navigation bar you have to change these two elements:
    • Code:
      table[width="100%"]:first-child { ... }
      affects your header containing the logo and
    • Code:
      table:nth-child(2) { ... }
      affects your navigation bar only


    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
    Ape
    Administrator
    Administrator


    Male Posts : 19435
    Reputation : 2010
    Language : fluent in dork / mumbojumbo & English haha

    In progress Re: Locking The Header

    Post by Ape May 9th 2019, 9:23 am

    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.



    Locking The Header Left1212Locking The Header Center11Locking The Header Right112
    Locking The Header Ape_b110
    Locking The Header Ape1010
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    In progress Re: Locking The Header

    Post by TheCrow May 9th 2019, 10:46 am

    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
    Code:
    position: absolute;
    will 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: fixed;
    otherwise, only the code provided above without any positioning will work. If not try applying
    Code:
    !important
    to the end of each line as below:
    Code:
    margin-left: 10px!important;


    Regards.
    Zeta
    Zeta
    Forumember


    Posts : 211
    Reputation : 2
    Language : English

    In progress Re: Locking The Header

    Post by Zeta May 9th 2019, 11:35 am

    TheCrow 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 that
    Code:
    position: absolute;
    will 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: fixed;
    otherwise, only the code provided above without any positioning will work. If not try applying
    Code:
    !important
    to the end of each line as below:
    Code:
    margin-left: 10px!important;


    Regards.
    I never said that you said that
    Code:
    position: absolute
    will fix the issue. I was trying to explain that
    Code:
    position: fixed
    is not what I'm looking for and that
    Code:
    position: absolute
    is closer to what I want.
    I added the
    Code:
    !important
    to the margin code and it is still turning my whole forum into a chaotic mess...
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    In progress Re: Locking The Header

    Post by TheCrow May 9th 2019, 1:23 pm

    @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.



    Locking The Header Thecro10
     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
    Zeta
    Forumember


    Posts : 211
    Reputation : 2
    Language : English

    In progress Re: Locking The Header

    Post by Zeta May 10th 2019, 3:58 am

    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.
    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.
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51554
    Reputation : 3524
    Language : English
    Location : United States

    In progress Re: Locking The Header

    Post by SLGray May 10th 2019, 5:37 am

    Is this an issue on all devices and browsers?



    Locking The Header Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    Zeta
    Zeta
    Forumember


    Posts : 211
    Reputation : 2
    Language : English

    In progress Re: Locking The Header

    Post by Zeta May 10th 2019, 7:46 am

    SLGray wrote:Is this an issue on all devices and browsers?
    All of the ones I have, at least. I can't speak for ones I don't have.

      Current date/time is November 13th 2024, 7:02 pm