Center Social Bookmarks - this worked for me

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BHM
    New Member
    • Jun 2009
    • 12
    • 3.8.x

    Center Social Bookmarks - this worked for me

    I tried the suggestions in the two threads I found on the subject, but they did not work for me. Here is how I got them to center using tables:

    In Show Thread Templates>>SHOWTHREADS

    Search for "social bookmarking links" and scroll down a few lines to

    Code:
    <td class="alt2" style="padding-top:0px"><div style="clear:both"></div><ul style="list-style-type:none; margin:0px; padding:0px">$bookmarksites</ul><div style="clear:both"></div></td>
    Add the tables indicated in red so it looks like this:

    Code:
    <td class="alt2" style="padding-top:0px"><div style="clear:both"></div>[COLOR=Red]<table width=100% cellspacing=0 cellpadding=0 border=0><tr><td align="center"><table cellspacing=0 cellpadding=0 border=0><tr><td>[/COLOR]<ul style="list-style-type:none; margin:0px; padding:0px">$bookmarksites</ul> [COLOR=Red]</td</tr></table></td</tr></table>[/COLOR]<div style="clear:both"></div></td>
    That will center them, but the default links won't look too much different because of the forced wide spacing between each link.

    To fix that, in Show Thread Templates>>showthread_bookmarksite

    change the first line from this:

    Code:
    <li class="smallfont" style="width:25%; min-width:160px; float:$stylevar[left]; margin-top:$stylevar[cellpadding]px">
    to this:

    Code:
    <li class="smallfont" style="float:left; margin-top:$stylevar[cellpadding]px; margin-left:10px; margin-right:10px;">
    That puts 20 pixels between each link and 10 on each end.

    You can adjust the spacing to accommodate different numbers of links by adjusting the values of margin-left and margin-right. Or you can just use one or the other but the result will be slightly off-center one way or the other.
  • Floris
    Senior Member
    • Dec 2001
    • 37767

    #2
    Do you have a live demo or screenshot?

    Comment

    • BHM
      New Member
      • Jun 2009
      • 12
      • 3.8.x

      #3
      Here are screenshots at two resolutions. As you can see, with many links at lower resolutions, they don't wrap properly, probably because the code uses ul and li to display them. Someday when I have time, I'll mess with it to see if I can find a better way so wrapped lines both center properly.



      And for those interested, the live site is the Backwoods Home Magazine Forum.
      Last edited by BHM; Mon 22 Jun '09, 6:41am. Reason: Never learned to check spelling before posting

      Comment

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