Why text-align: center and float: center doesn’t work on forum category title in vB5?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Anton Rahman
    Member
    • Nov 2014
    • 53
    • 4.2.x

    Why text-align: center and float: center doesn’t work on forum category title in vB5?

    Why text-align: center and float: center doesn’t work on forum category title in vB5?

    For example try adding the following to additional.css “in Vb5”
    #forumX.category-header
    {
    background: #033144;
    }

    And it works like a charm, you get a new background color for your forum category identified by X node ID, but hey , why:
    #forumX.category-header
    {
    color: #FFFFFF;
    }
    Never works in changing the font color of the same target forum category node ID???
    Interesting right ?
    PS. The capital X stands for whatever node ID you wanna target in your css mod.
    Its kindda interesting that why if you wanna change the font color of that particular forum category node ID , you have to do:
    .category[data-nodeid="X"]
    {
    color: #FFFFFF;
    this time it works !!
    Any ideas on what is the reason?
    Now lets move on to the one million dollar question
    Why in both cases and in any other way that:
    text-align: center and float: center
    will not work on forum category headers !!!!
    Any ideas will help
    Kindly note , this is for vBulletin 5, we are aware that there had been many successful codes to accomplish that in all former vBulletin versions , but so far none for vBulletin 5
    Any advice is appreciated
  • Mark.B
    vBulletin Support
    • Feb 2004
    • 24286
    • 6.0.X

    #2
    float:center isn't valid css.

    For other stuff, you sometimes need to add !important.

    With category headers, the text is a link, so you will need to specify this in the css.
    MARK.B
    vBulletin Support
    ------------
    My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
    My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

    Comment

    • Anton Rahman
      Member
      • Nov 2014
      • 53
      • 4.2.x

      #3
      we have used !important , the code we mentioned is an example of what already worked , i.e changing background color and font color

      any direct way please on how to center category headers that can hopefully be targeted to specific node ID's ?

      Comment

      • Mark.B
        vBulletin Support
        • Feb 2004
        • 24286
        • 6.0.X

        #4
        This code will center all category headers.
        Code:
        .forum-list-container .forum-list-header + .category-header td {
        text-align: center;
        }
        MARK.B
        vBulletin Support
        ------------
        My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
        My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

        Comment

        • Anton Rahman
          Member
          • Nov 2014
          • 53
          • 4.2.x

          #5
          tnx for the prompt reply, but we did add this code to additional.css as per your advice; but no change at all !!
          Jus in case, we also cleared cache but still no effect
          we also remove all other codes except your suggested code from additional.css
          argumentatively we even added "alternately"

          color: #FFFFFF!important;

          and also

          background: #033144;

          with and without !important

          but as far as it concerns the given code
          .forum-list-container .forum-list-header + .category-header td { text-align: center; } did not affect any style attributes of forum headers titles / categories including to center the text

          any idea please why this code didn't work ?

          we are looking for a direct code that can center text of specific node id's of the forum header titles especially those set as categories

          note : we are using vB 5.3.3, without any code modifications or mods of any kind, we just simply installed vBulletin 5.3.3 on xampp local host for the purpose of developing a pre-production prototype of our intended forum, we are also using default theme

          Thank you very much for your patience

          Comment

          • Anton Rahman
            Member
            • Nov 2014
            • 53
            • 4.2.x

            #6
            the guys from SEVEN SKINS posted a very interesting reply to the same query posted on vbulletin.org, you may view the thread at https://vbulletin.org/forum/showthread.php?t=325751

            here's their code

            .forum-list-container .category-header .category { float: none; } .forum-list-container .category-header td { text-align: center; } works like a charm but how can we target specific node id's ??

            Comment

            • Wayne Luke
              vBulletin Technical Support Lead
              • Aug 2000
              • 73981

              #7
              Originally posted by Anton Rahman
              but how can we target specific node id's ??
              If you used your browser's development tools and inspected the elements, you would see that every forum has a unique id assigned to it based on its nodeid value. id="forum36" as an example. All the forum nodeids are listed in the Channel Manager in the AdminCP if you don't want to inspect every element.

              Code:
              <tr class="forum-item main forum-item" id="forum28" data-channel-id="28" data-lastcontent="1510093550" data-readtime="1510093559">
              #forum28, .forum-item #forum28 or [data-channel-id="28"] would target the specific forum.
              Translations provided by Google.

              Wayne Luke
              The Rabid Badger - a vBulletin Cloud demonstration site.
              vBulletin 5 API

              Comment

              • Anton Rahman
                Member
                • Nov 2014
                • 53
                • 4.2.x

                #8
                best answer is



                works perfectly and direct to the point !!

                Thank you Seven Skins !

                And thanks to everyone here who also contributed their best and their most valuable time!!

                SOLVED!

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...