MyBB Community Forums

Full Version: [Tutorial] Centering the logo.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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>
Or the more proficient method.

Alter the theme css and add this.

.logo {text-align:center;}
(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
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.
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.
Thanks My Friend Smile
Thank you my friend babjusi . If you read this post , please come back , we want you back .
Helpful tut Smile Thank you.
Like labrocca said, there is already a class defined, why in the world are you using inline styling?
nice tutorial Big Grin
Pages: 1 2