Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Aiheen aloitti: colby2152 - lokakuu 26, 2011, 08:17:50 IP

Otsikko: Center logo and menu?
Kirjoitti: colby2152 - lokakuu 26, 2011, 08:17:50 IP
Simple request... I want to center the logo and navigation menu.  Where in the CSS do I edit the left to center alignment?
Otsikko: Re: Center logo and menu?
Kirjoitti: colby2152 - lokakuu 27, 2011, 10:24:44 IP
I am not sure why this was moved to Graphics... it is about editing CSS to center the logo and navigation menu of SMF.
Otsikko: Re: Center logo and menu?
Kirjoitti: ARG01 - lokakuu 27, 2011, 11:05:05 IP
Maybe try a search. I am not going to bother searching but I know that there are quite a few topics here that cover exactly what you need.

;)
Otsikko: Re: Center logo and menu?
Kirjoitti: Sir Osis of Liver - lokakuu 27, 2011, 11:45:38 IP

Varies with theme, but this does it -



/// Center menu

echo '
</div>

<div id="toolbar" align="center">
<div style="display: inline-block;">
',template_menu(),'
</div>
</div>


Otsikko: Re: Center logo and menu?
Kirjoitti: colby2152 - lokakuu 28, 2011, 08:30:22 AP
Lainaus käyttäjältä: Krash. - lokakuu 27, 2011, 11:45:38 IP

Varies with theme, but this does it -



/// Center menu

echo '
</div>

<div id="toolbar" align="center">
<div style="display: inline-block;">
',template_menu(),'
</div>
</div>



None of that worked.  I was hoping to do this in the index.css anyways. ARG - I did search but everything I tried didn't work.
Otsikko: Re: Center logo and menu?
Kirjoitti: Sir Osis of Liver - lokakuu 28, 2011, 03:48:33 IP

You have to change id="toolbar" to what's in your /css/index.css for the menubar div.

Attach your index.template.php and I'll have a look.

Otsikko: Re: Center logo and menu?
Kirjoitti: Antechinus - lokakuu 28, 2011, 03:59:56 IP
Take a look in my sig. Alternatively, read this (which is where I got the idea for the mod): http://matthewjamestaylor.com/blog/centered-dropdown-menus
Otsikko: Re: Center logo and menu?
Kirjoitti: colby2152 - lokakuu 28, 2011, 06:23:53 IP
Lainaus käyttäjältä: Krash. - lokakuu 28, 2011, 03:48:33 IP

You have to change id="toolbar" to what's in your /css/index.css for the menubar div.

Attach your index.template.php and I'll have a look.

Thanks... it is attached.
Otsikko: Re: Center logo and menu?
Kirjoitti: Sir Osis of Liver - lokakuu 28, 2011, 10:27:46 IP


// Show the menu here, according to the menu sub template.

echo '
<div align="center">
<div style="display: inline-block;">
', template_menu() ,'
</div>
</div>';

echo '
</div>
</div>';


// The main content should go here.



Otsikko: Re: Center logo and menu?
Kirjoitti: Antechinus - lokakuu 29, 2011, 03:21:06 IP
Why do you want to hack the markup with extra divs, deprecated attributes and inline css when you can get the same result with a few minor index.css tweaks?
Otsikko: Re: Center logo and menu?
Kirjoitti: colby2152 - lokakuu 29, 2011, 03:32:59 IP
Lainaus käyttäjältä: Antechinus - lokakuu 29, 2011, 03:21:06 IP
Why do you want to hack the markup with extra divs, deprecated attributes and inline css when you can get the same result with a few minor index.css tweaks?

That's what I am looking for - but how can I do this?
Otsikko: Re: Center logo and menu?
Kirjoitti: Antechinus - lokakuu 29, 2011, 03:36:22 IP
Lainaus käyttäjältä: Antechinus - lokakuu 28, 2011, 03:59:56 IP
Take a look in my sig. Alternatively, read this (which is where I got the idea for the mod): http://matthewjamestaylor.com/blog/centered-dropdown-menus
Otsikko: Re: Center logo and menu?
Kirjoitti: Sir Osis of Liver - lokakuu 29, 2011, 04:11:56 IP
Lainaus käyttäjältä: Antechinus - lokakuu 29, 2011, 03:21:06 IP
Why do you want to hack the markup with extra divs, deprecated attributes and inline css when you can get the same result with a few minor index.css tweaks?

It werks gud. (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.thekrashsite.com%2Fpics%2Fthu.gif&hash=f4392e100b91a27ad55c137fafc83bec6aefd9cf)

Otsikko: Re: Center logo and menu?
Kirjoitti: Antechinus - lokakuu 29, 2011, 04:13:41 IP
So do the few minor css tweaks. ;)