MyBB Community Forums
[Tutorial] Centering the logo. - Printable Version

+- MyBB Community Forums (
+-- Forum: Resources (
+--- Forum: Tutorials (
+--- Thread: [Tutorial] Centering the logo. (/thread-60146.html)

Pages: 1 2

[Tutorial] Centering the logo. - babjusi - 2009-11-24

I have come across many posts here where users have asked how to center the logo. I have answered some of them and thought it would be best to make a sort of tutorial about it so it can save a lot of time in the future to those that want to accomplish such a thing.

Anyway, here we go:

To center the default logo, find at the Header templates-header the following code:

<div class="logo" ><a href="{$mybb->settings['bburl']}/index.php"><img src="{$theme['logo']}" alt="{$mybb->settings['bbname']}" title="{$mybb->settings['bbname']}" /></a></div>

and replace it with:

<div class="logo" style="margin:0 auto;text-align:center"><a href="{$mybb->settings['bburl']}/index.php"><img src="{$theme['logo']}" alt="{$mybb->settings['bbname']}" title="{$mybb->settings['bbname']}" /></a></div>

RE: [Tutorial] Centering the logo. - labrocca - 2009-11-25

Or the more proficient method.

Alter the theme css and add this.

.logo {text-align:center;}

RE: [Tutorial] Centering the logo. - babjusi - 2009-11-25

(2009-11-25, 12:45 AM)labrocca Wrote: Or the more proficient method.

Alter the theme css and add this.

.logo {text-align:center;}

What took you so long Big Grin

And why would that be a more proficient method btw? That class ain''t defined in the css. In that case my method which modifies an already built in option would be more proficient method, wouldn''t you say Wink

RE: [Tutorial] Centering the logo. - labrocca - 2009-11-25

1. Styles should be in the css that's what it's for.
2. My version is actually less characters.
3. A person might want to add other css styles changes so adding the logo style is wise.

RE: [Tutorial] Centering the logo. - babjusi - 2009-11-25

We aren''t talking about decorating the logo here but to center it and by using the style directly to the header gets the job done nicely and properly. But I don''t want to argue, your stile is better than my style or vica-versa. It is up to the users to use whatever method they see best.

RE: [Tutorial] Centering the logo. - commandermadi - 2010-05-10

Thanks My Friend Smile

RE: [Tutorial] Centering the logo. - mario4 - 2010-05-16

Thank you my friend babjusi . If you read this post , please come back , we want you back .

RE: [Tutorial] Centering the logo. - Crystal31 - 2011-11-20

Helpful tut Smile Thank you.

RE: [Tutorial] Centering the logo. - Jason L. - 2011-11-20

Like labrocca said, there is already a class defined, why in the world are you using inline styling?

RE: [Tutorial] Centering the logo. - mala - 2014-06-14

nice tutorial Big Grin