Skip to content

Footer bar add center text

Solved Customisation
  • @DownPW sorry. Try either

    display: inline;
    

    Or

    display: inline-block;
    

    You might need !important depending on cascading settings

    Edit - for clarity, this should be in the #floatcenter block

  • @phenomlab

    Houra, itโ€™s OK with inline-block

    On the other hand, I see that the text is well centered in the div but I notice that the div itself is not centered.
    Indeed I see a substantial space between the floatcenter div and floatright div.
    You can see it in the screenshot below.

    e1fb1c73-e19d-4548-aa73-9f8456830018-image.png

    Again my HTML/CSS

    <div id="floatcenter"> Some centered text
        </div>
    
    #floatcenter {
        bottom: 1px;
        font-size: 90%;
        line-height: 2.3;
        font-weight: bold;
        color: #666666 !important;
        margin: auto auto;
        text-align: center;
        width: 50%;
        display: inline-block !important;
    }
    
  • @DownPW strange. I donโ€™t recall seeing that issue when I created this using the console live on your site. This is likely due to width constraints on the parent div.

    In the above CSS you could try to set width to auto rather than 50%, but then you will need to set width: 100%; on the parent div

  • @phenomlab

    I have test with width: 50%;, I have the floatright OK with not space like before but the text is not centered.

    4ff9abbf-889c-42ac-9202-3dd1465eb0c7-image.png

  • @DownPW ok. Let me have a look at this later. Can you leave everything as it is - I know it doesnโ€™t look right but I want to make sure the right css is provided for the html you are using and itโ€™s easier to do this live.

    Perhaps set the floatcenter element to be hidden for the time being?

  • @phenomlab

    Yep I will set display: none on floatcenter div for waiting

    I notice I can centered the text when I play with margin-left for example but is not auto-centered according to the text

    Itโ€™s still better but I would like it to center automatically based on the text rather than manually.

    we will get there

  • @DownPW Ok, try this

    #floatcenter {
        bottom: 1px;
        font-size: 90%;
        line-height: 2.3;
        font-weight: bold;
        color: #666666 !important;
        margin: 0 auto;
        text-align: center !important;
        max-width: 50%;
    }
    #floatright {
        float: right;
        bottom: 1px;
        font-size: 90%;
        line-height: 2.3;
        display: flex;
        position: sticky;
    }
    

    Donโ€™t add to the CSS blocks you have - you need to replace them. This should yield the below - see the position markers - the lilac is centered on the screen, whilst the other two div tags occupy the remainder.

    055d6573-f3d7-41b0-93f3-8bfff20737b4-image.png

    There is a caveat in the sense that this doesnโ€™t scale very well - mostly because of the existing position: fixed; and the need to set position: sticky; on the right-most element of #floatright. Based on this, it would be sensible to hide #floatcenter on the mobile breakpoints to prevent the text from overlapping.

  • @phenomlab

    Ah ok you play with max-width: 50%; on floatcenter and position: sticky; on floatright

    Thatโ€™s smart ๐Ÿ˜‰ I didnโ€™t necessarily think of that.


    The result is perfect except on smartphone as you said.

    โ€“> I tried this as usual but it doesnโ€™t work. An idea?

    @media (max-width: 768px) {
        #floatcenter {
            display: none !important;
        }  
    }
    

    EDIT: Yep this code works for not display floatcenter div. I must find for floatright div
    EDIT2: Ok @phenomlab with floatright div with this code :

    @media (max-width: 767px) {
    #floatright {
        float: right;
        bottom: 1px;
        font-size: 90%;
        line-height: 2.3;
        display: flex !important;
        position: static;
    } 
    }
    

    If you have a better solution tell me Mark ๐Ÿ˜‰

    A big big thank you bro ๐Ÿ‘

  • @DownPW that should work - unless itโ€™s inherited higher up in the cascade. If you resize the browser to match a mobile device, does it appear in the DOM?

  • @DownPW said in Footer bar add center text:

    If you have a better solution tell me Mark
    A big big thank you bro

    No, that should work and itโ€™s a good mix. Just watch for very large displays as you may get unexpected placing of elements, but I doubt anyone will ever encounter this unless they run their browser using the entire screen estate.

    Highly unlikely I think.

  • @phenomlab

    I did the test on my desktop 34-inch screen in browser full screen and it works, then goes on my smartphone. (OnePlus 8T)

    Everything is fine unless I missed something ๐Ÿ˜‰

    I mark as solved ๐Ÿ™‚

  • DownPWundefined DownPW has marked this topic as solved on
  • @DownPW thatโ€™s great news. Seems to work on my 32" desktop monitor fine, and also on my OnePlus 9 Pro ๐Ÿ˜

  • @phenomlab

    very odd, there are a bug :

    โ€“> floatright text is invisible only on Firefox and is OK on chromium browser with the same code ?!

  • Other bug :

    On home page. I must scroll down to see the footerbar.
    Sheโ€™s not appear directly

  • And lasts bugs on firefox Mobile (test with a smartphone, not on an develloper view on desktop) :

    • Like on chromium browser smartphone : On home page. I must scroll down to see the footerbar. Sheโ€™s not appear directly

    • On firefox mobile, I have these when I scroll all the way down and when I scroll up/down:

    02fda5d2-c617-4dd6-9ee8-968bdd703f89-image.png 451947b8-c9e3-44c3-a356-08ce806de3b3-image.png

  • DownPWundefined DownPW has marked this topic as unsolved on
  • @DownPW said in Footer bar add center text:

    floatright text is invisible only on Firefox and is OK on chromium browser with the same code ?!

    Typical Mozilla.

    Use this instead

    #floatright {
      float: right;
      bottom: 1px;
      font-size: 90%;
      line-height: 2.0;
      display: flex;
      position: fixed;
      right: 10px;
    }
    

    You might find that this messes with the alignment of text, so youโ€™ll need to adjust line-height accordingly, or make the difference up with either margin or padding

    The #console-nav-footer element disappearing on Firefox is due to a bug - see https://bugzilla.mozilla.org/show_bug.cgi?id=1585254 and https://bugzilla.mozilla.org/show_bug.cgi?id=1760924

    The issue here is that the .row class used in core is set as below

    970e8fac-23c7-4621-975c-423a152ab3dd-image.png

    In Firefox, this has the undesired artefact of pushing other divs down because the browser interprets this as outside of the margins. You can prove this theory by removing the tick from the margin-right class shown above when in DEV mobile view - you should see the footer appear as soon as you remove the margin-right value from .row - in effect, you are setting the margins back to 0 meaning the content is rendered correctly.

    You could write a custom JS function to apply the right CSS to resolve this issue, but in fairness, itโ€™s very easy to fake the Browser String, which could lead to more problems that you set out to solve.

    There are other ways to address this specific issue, but if it were me, Iโ€™d accept the bug until the Mozilla team actually address it.

  • @phenomlab Thanks for the information, after research it seems to firefox donโ€™t like sticky position too ๐Ÿ˜ž

    I will test tonight your fix, Iโ€™m on the office actually

    Thanks

  • @DownPW no problems. Let me know how it goes

  • @phenomlab

    problem resolv for floatright on Firefox desktop with your last css above. thanks ๐Ÿ‘
    For information, in my research I have seen this link wit hother fix (not tested) : https://stackoverflow.com/questions/27521676/position-sticky-not-working-in-firefox

    ๐Ÿ˜‰


    โ€“> Now, I search to resolve if possible these 2 smartphone bugs (only on Firefox mobile version, OK on Chromium-based browsers ) :

    A- if I collapse the footerbar I end up with black space at the bottom :

    c7f4ce50-325a-4307-8fc4-eefe8296cdba-image.png

    B- In fact, the footerbar remains fixed and does not come down automatically if you zoom in on a page. Ceal works on Chromium-based browsers (vivaldi, brave, etc.)

    You have the same bug on sudonix

  • @DownPW absolutely another Firefox related bug, so will need to check this. I donโ€™t typically use Firefox myself so Iโ€™m not surprised at all that this specific issue manifests itself on sudonix also.

  • DownPWundefined DownPW has marked this topic as solved on

Did this solution help you?
Did you find the suggested solution useful? Why not buy me a coffee? It's a nice gesture, and a great way to show your appreciation ๐Ÿ’—

Related Topics
  • hover link effect

    Solved Customisation
    18
    6 Votes
    18 Posts
    1k Views

    @DownPW Looking at the underlying code, class start is being added on hover by jQuery in this function

    document.querySelectorAll(".button-gradient, .button-transparent").forEach((button) => { const style = getComputedStyle(button); const lines = document.createElement("div"); lines.classList.add("lines"); const groupTop = document.createElement("div"); const groupBottom = document.createElement("div"); const svg = createSVG( button.offsetWidth, button.offsetHeight, parseInt(style.borderRadius, 10) ); groupTop.appendChild(svg); groupTop.appendChild(svg.cloneNode(true)); groupTop.appendChild(svg.cloneNode(true)); groupTop.appendChild(svg.cloneNode(true)); groupBottom.appendChild(svg.cloneNode(true)); groupBottom.appendChild(svg.cloneNode(true)); groupBottom.appendChild(svg.cloneNode(true)); groupBottom.appendChild(svg.cloneNode(true)); lines.appendChild(groupTop); lines.appendChild(groupBottom); button.appendChild(lines); button.addEventListener("pointerenter", () => { button.classList.add("start"); }); svg.addEventListener("animationend", () => { button.classList.remove("start"); }); }); })

    The CSS for start is below

    .button-gradient.start .lines svg, .button-transparent.start .lines svg { animation: stroke 0.3s linear; }

    And this is the corresponding keyframe

    @keyframes stroke { 30%, 55% { opacity: 1; } 100% { stroke-dashoffset: 5; opacity: 0; } }

    Itโ€™s using both CSS and SVG, so might not be a simple affair to replicate without the SVG files.

  • Changing the look of recent cards

    Announcements
    1
    2 Votes
    1 Posts
    277 Views
    No one has replied
  • Link Text Colour.

    Solved Customisation
    5
    2 Votes
    5 Posts
    427 Views

    @phenomlab Thx again for the reply.

    Well I am sure that it will be well worth the wait. ๐Ÿ™‚ I will watch with anticipation. For now it is OK. Just small minor irritations I fell in a lot of NodeBB โ€˜defaultโ€™ things.

  • background color of the footer area

    Solved Customisation
    7
    7 Votes
    7 Posts
    514 Views

    @phenomlab thank you very much ๐Ÿ™‚

  • 2 Votes
    10 Posts
    1k Views

    @DownPW

    We just have to change the cycles automatically according to each period ?

    Yes, this is by far the safest

    I think it is possible to achieve the goal, I have already seen this kind of thing on a site without any perf problems.

    Itโ€™s certainly possible, but not without issues or impact to performance (in my view)

  • Avatar on Topic Header

    Solved Customisation
    9
    0 Votes
    9 Posts
    678 Views

    @jac said in Avatar on Topic Header:

    @downpw said in Avatar on Topic Header:

    Great Plugin ๐Ÿ™‚

    I make it a bit cleaner via this CSS code:

    /*------------------------------------------------------------------*/ /*---------------- nodebb-plugin-browsing-users -----------------*/ /*------------------------------------------------------------------*/ /*Space between the avatar and the RSS icon */ .topic [component="topic/browsing-users"] { margin-bottom: -5px; padding-left: 10px; } /*Space between avatars*/ .pull-left { float: left!important; padding-right: 5px; }

    Do you have a screenshot of how this looks with the CSS change?

    Just added this change, thanks @DownPW ๐Ÿ™‚

  • NodeBB Footer

    Solved Customisation
    10
    1 Votes
    10 Posts
    1k Views

    @phenomlab said in NodeBB Footer:

    @jac and you. Hope all is well and you recover quickly

    Thanks pal ๐Ÿ˜๐Ÿค๐Ÿป

  • Multiple link on one ico non Navbar

    Solved Customisation
    7
    2 Votes
    7 Posts
    541 Views

    yeah youโ€™re right @phenomlab.
    Problem of NodeBB Version