vBulletin

Thank you for visiting. This is our website archive. Please visit our main website by clicking the banner above.
vBulletin FAQ is dedicated to helping the forum owner build, manage and profit from his vBulletin Forum
vBulletin Web Hosting - Free skins and styles for your vBulletin - Search Engine Optimization




How to center logo in header

Greg
04-09-2007, 07:05 AM
Simple question - I changed the image that appears in the header and it appears on the left just like the default logo. How can I center it?

Dave A
04-09-2007, 08:45 AM
Admin CP > Styles and templates> Style Manager > click GO button next to style to edit
Find this in your header template (about 4 lines down):
<td align="$stylevar[left]"><a href="$vboptions[homeurl]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>

change left to center

Greg
04-09-2007, 11:17 AM
Dave - thanks but I tried that and it did not work. Any other ideas?

Peggy
04-09-2007, 11:28 AM
Dave - thanks but I tried that and it did not work. Any other ideas?
Yup -

<!-- logo -->
<a name="top"></a>
<table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="$stylevar[center]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions" /></a></td>
[B]<td align="$stylevar[right]">
&nbsp;
</td>
</tr>
</table>
<!-- /logo -->
<!-- content table -->
$spacer_open
$_phpinclude_output

make the edits in red, and delete the code in blue.

Greg
04-09-2007, 11:59 AM
Peggy:

Thanks but that does not work either. Here is the code for my header (with edits you suggested). Do you see anything wrong? Thanks


<!-- logo -->
<a name="top"></a>
<table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="$stylevar[center]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>
</tr>
</table>
<!-- /logo -->

<!-- content table -->
$spacer_open

$_phpinclude_output

Peggy
04-09-2007, 12:18 PM
I have NO idea then. did you try refreshing? Clearing your cache?
That code is exactly as it should be.

Greg
04-10-2007, 11:44 AM
Peggy, i changed the code in the header to this:

<!-- logo -->
<a name="top"></a>
<table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="center"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>
</tr>
</table>
<!-- /logo -->

<!-- content table -->
$spacer_open

$_phpinclude_output


And now the logo is centered. Dont ask me how or why - I just know that it works.

Peggy
04-10-2007, 02:38 PM
hmmm that is odd. The code I gave you works on every one of my styles that I center the header on. I took it right out of one of them.

Anyway, I'm glad you got it to work.

WhaLberg
04-10-2007, 02:40 PM
hmmm that is odd. The code I gave you works on every one of my styles that I center the header on. I took it right out of one of them.

Anyway, I'm glad you got it to work.

Yes, Peggy is right. The code she gave works well.

Dave A
04-10-2007, 02:52 PM
They all should work. All that's happened is you've taken out the right hand cell of the table row which is normally empty and reserved for banners etc. I can only think the right hand cell was sized somehow. Maybe in the CSS.

Anyway, glad you got there.

Greg
04-13-2007, 02:34 PM
Dave: Where in css would be sizing be for the right hand cell?


Thanks

Dave A
04-13-2007, 03:21 PM
Hmm. I've taken a closer look at your code changes. Your issue had nothing to do with the right hand cell. That was gone in the code that didn't work anyway.

The problem was the $stylevar. This does mean the CSS was interfering with the center instruction. I'll have to get back to you on which one it might be, though. You're using a custom skin, right?

EDIT: BTW, If you want to add the right hand cell, it's the code in blue in Peggy's post.

Peggy
04-13-2007, 03:37 PM
That right hand cell has no sizing that I know of. It's purposely devoid of sizing so that it will expand or not, according to the size of the banner/image/etc that is entered into it.

Dave A
04-13-2007, 03:50 PM
Spot on, Peggy. The problem was the $stylevar[center] setting. The change to just plain old center did the trick. I'm trying to figure why $stylevar messed it up :confused:

Peggy
04-13-2007, 04:57 PM
I do remember now, having to delete the $stylevar part and make it just center, a few times. Too bad I didn't remember it earlier :rolleyes:


vBulletin

seo book

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum