How can I center the top menu?

Started by KahneFan, January 16, 2009, 08:39:15 PM

Previous topic - Next topic

KahneFan

UGH! This is frustrating me!! How do I go about centering the (default theme) HOME | HELP |... menu?

I've found the main_menu in /css/index.css , but I can't figure out why it's left aligned and how to center it. If I can't center it, then a 100% span would be OK as well.
#eric_on_twit| (video) Creating Themes for SMF | Reset Your Forum
NOTE: No PM's for support please.

Tyrsson

Its not aligned left. Its floated left I think.


It will depend on how you want to go about centering it. It is actually easier to add new classes to the css and list it as .tabs, then center the menu (for me it is anyway).

After that then you will of course need to make new images for the menu tabs (will only need four if you do it right two for active and two for non active).

Then you can actually center it via padding and it will move dynamically with a change in monitor size.
PM at your own risk, some I answer, if they are interesting, some I ignore.

Tyrsson

That is as long as you define the padding in %
PM at your own risk, some I answer, if they are interesting, some I ignore.

KahneFan

The top menu is different sizes for different members and if mods are added it could change the size as well. So, it would need to be truly centered. Wouldn't padding give a different center to every member depending on their member status (admin/mod/guest/...)

As for a new style, basically ignore the current main_menu and create a new style group?
#eric_on_twit| (video) Creating Themes for SMF | Reset Your Forum
NOTE: No PM's for support please.

mashby

Why not just do something like this?
// Show the menu here, according to the menu sub template.
echo '<center>';
template_menu();
echo '</center>';
Always be a little kinder than necessary.
- James M. Barrie

Tyrsson

It wont work, or it wont in 2.x anyway. Never tried it in 1.x
PM at your own risk, some I answer, if they are interesting, some I ignore.

Advertisement: