View Full Version : Span align question
mathforum
11-23-2013, 11:35 PM
Hi everyone,
I want to add some text to the same line in the postbit legacy template which contains the post date and post number. I've found the right location and the code I need works but I can't get it to align properly. Here's a picture of what it looks like now.
https://vborg.vbsupport.ru/external/2013/11/20.png
First I tried: <span style="color: #a22547; text-transform: uppercase;
font-weight: bold;text-align=center">
</span>
but that ended up with the text appearing right next to the date. So for now the only thing I could think of was adding manual spaces in html a few times to create some kind of gap for now. This is a horrible method though and obviously I can't use this as a solution so any ideas as to how I can align this text "Thread Author" in the center of the text box?
ozzy47
11-23-2013, 11:39 PM
What is the location you added that to?
mathforum
11-23-2013, 11:42 PM
Just after this bit in the legacy template:
<span class="date" style="color: #a22547; text-transform: uppercase; font-weight:
bold;">{vb:raw post.postdate}<vb:if condition="!$show['detailedtime']">, <span class="time" style="color: #a22547;">{vb:raw post.posttime}</span></vb:if>
</span>
</vb:if>
ozzy47
11-23-2013, 11:49 PM
Try this.
<span style="color: #a22547; text-transform: uppercase;
font-weight: bold; float:right;">Thread Author
</span>
mathforum
11-23-2013, 11:53 PM
Now it's on the right side against the post number. Tried using float:center as well but didn't work. :confused:
https://vborg.vbsupport.ru/external/2013/11/19.png
ozzy47
11-24-2013, 12:01 AM
Ok try this one.
<span style="color: #a22547; text-transform: uppercase;
font-weight: bold; padding-left:auto; padding-right:auto;">Thread Author
</span>
mathforum
11-24-2013, 12:09 AM
:(
Now it's back to the left side. I wish I had better news and I appreciate your time!
ozzy47
11-24-2013, 12:12 AM
Can you pm me a admin account, so I can try it on your site, as I am able to center it fine on mine.
Max Taxable
11-24-2013, 12:14 AM
Maybe try:
<span class="date" style="color: #a22547; text-transform: uppercase; font-weight:
bold; padding-left:auto; padding-right:auto;">Thread Author
</span>
Just after this bit in the legacy template:
<span class="date" style="color: #a22547; text-transform: uppercase; font-weight:
bold;">{vb:raw post.postdate}<vb:if condition="!$show['detailedtime']">, <span class="time" style="color: #a22547;">{vb:raw post.posttime}</span></vb:if>
</span>
</vb:if>Also, put it before the </vb:if> conditional not after.
mathforum
11-24-2013, 12:24 AM
@Max - still didn't work. We have a very custom forum design so maybe there is some non-standard CSS attribute messing this up. Appreciate the suggestion.
ozzy47 is taking a look at my code right now I think so we'll see what he finds.
Max Taxable
11-24-2013, 12:26 AM
Those can be tricky especially if they are based on earlier versions of vB than you are running.
mathforum
11-24-2013, 12:36 AM
Ok, ozzy47 was kind enough to check this out and found a different solution. He added a manual left-padding value which seems to work ok. I'll be looking into how this appears on different screens but it seems good right now! :)
<vb:if condition="$thread['postuserid'] == $post['userid']" >
<span style="color: #a22547; text-transform: uppercase; font-weight:
bold; padding-left:170px;">Thread Author
</span>
ozzy47
11-24-2013, 12:41 AM
Yeah let me know, if it don't look good, I'll try some other things. :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.