Forum List Container - Margins

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Flash04jv
    Senior Member
    • Aug 2015
    • 474
    • 5.1.x

    Forum List Container - Margins

    Looking to remove some of the margins/padding in the photo posted. Been trying to create all kinds of CSS codes with margins but can't get it to work. I have been putting this after a bunch of codes
    Code:
    { margin-top: -40px; }
    . Changing the -40px to see if anything happens but nothing yet.

    This is the code that I see when I highlight the area with Inspect Element.
    Code:
    .forum-list-container .forum-item
    Trying to remove the space above the title and below the description.



  • Replicant
    Senior Member
    • Sep 2014
    • 527

    #2
    There are actually several classes that effect that spacing. These will get you started on your code snowball.
    Code:
    td.cell-forum, .lastpost, topics-count, posts-count {
        padding-top: 6px!important;
        padding-bottom: 2px!important;
    }


    Comment

    • glennrocksvb
      Former vBulletin Developer
      • Mar 2011
      • 4021
      • 5.7.X

      #3
      Originally posted by Replicant
      There are actually several classes that effect that spacing. These will get you started on your code snowball.
      Code:
      td.cell-forum, .lastpost, topics-count, posts-count {
      padding-top: 6px!important;
      padding-bottom: 2px!important;
      }
      Typo. You missed the dot.
      Code:
      td.cell-forum, .lastpost, [SIZE=20px][COLOR=#FF0000][B].[/B][/COLOR][/SIZE]topics-count, [SIZE=20px][COLOR=#FF0000][B].[/B][/COLOR][/SIZE]posts-count {
          padding-top: 6px!important;
          padding-bottom: 2px!important;
      }
      Flash04jv the reason your code was not working because margins don't work on table rows (tr) and cells (td).

      Flag Icon Postbit Insert GIPHY Impersonate User BETTER INITIALS AVATAR Better Name Card Quote Selected Text Bookmark Posts Post Footer Translate Stop Links in Posts +MORE!

      Comment


      • Flash04jv
        Flash04jv commented
        Editing a comment
        Dang, I wondered if I needed padding and not margins. I was going off the code I used for my read unread logos and some old threads on here. I'll give it a shot.

      • Replicant
        Replicant commented
        Editing a comment
        Thanks for the catch Glenn. I copied and pasted it from the dev environment, don't know why the dots didn't carry over.
    • Flash04jv
      Senior Member
      • Aug 2015
      • 474
      • 5.1.x

      #4
      Thanks Guys! Exactly what I was wanting! I am currently using these, this made it look exactly like the screen shots I got off our old forum. For some reason the bottom padding on the cell-forum was messing up our Blog cell if I made it smaller than like 8px, so I just deleted it for now.

      Code:
      .cell-forum
      {padding-top: 5px!important;}
      
      .lastpost
      {padding-top: 7px!important;
      padding-bottom: 9px!important;}
      What did the 'td' in front of the codes do? I removed those and nothing happened so I left them off. Also curious what these do:
      Code:
      !important
      They are in lots of my codes.

      Comment


      • Replicant
        Replicant commented
        Editing a comment
        The td is in there because it's part of the CSS path. Sometimes it's necessary, like if the same class is used in a div or a tr, the code would only affect the td. The !important will force the overwrite of stubborn CSS or hard coded CSS and should be used sparingly and only when necessary. If your initial code doesn't work right away, try the !important.

      • Flash04jv
        Flash04jv commented
        Editing a comment
        Oh, ok. Thanks for the info!
    • Flash04jv
      Senior Member
      • Aug 2015
      • 474
      • 5.1.x

      #5
      Is it possible to do this on a specific forum? I found the Forum IDs, but can I insert them in the code somehow to only affect that specific Forum?

      Something similar to this maybe? This isn't doing anything for me

      Code:
      .cell-forum .id=forum57
      {padding-top: 50px!important;}

      Comment

      • Replicant
        Senior Member
        • Sep 2014
        • 527

        #6
        You're close. Use the # sign for CSS id

        Code:
        #forum57 > td{
        padding-top: 50px!important;
        }
        Try it without !important first.


        Comment


        • Flash04jv
          Flash04jv commented
          Editing a comment
          Bingo! Works without the !important. So close, getting better at it I think.. Thanks!
      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...