Centering Menu Bar.

Started by Devicon, August 15, 2012, 10:24:25 PM

Previous topic - Next topic

Devicon

I have tried a few modifications, they didn't work. I'm looking to center my menu bar.

I'm using the theme Estalia.

Here is what i believe to by my menu code.

function template_body_above()
{
   global $context, $settings, $options, $scripturl, $txt, $modSettings;

   echo '
   <div id="body-top">
      <div id="top-banner">     
      </div>
   </div>
   
      ',template_menu(),'
   <div id="mainbody">
      <div class="clr"/></div>
      <div class="wrapper">';
         
     
   theme_linktree2(false,'white');
   
   //SMFPacks Shoutbox -->
   if (function_exists('template_shoutbox')) template_shoutbox('main');
   // <-- SMFPacks Shoutbox

Deaks

template_menu()


Look for this again at bottom of the index.template.php and post the code please, if there is any css classes or id's in it please also post them.
Thanks
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

Devicon

Quote from: Poύνικ on August 16, 2012, 10:41:59 AM
template_menu()


Look for this again at bottom of the index.template.php and post the code please, if there is any css classes or id's in it please also post them.
Thanks

That was in the code i posted.

Quote',template_menu(),'
   <div id="mainbody">
      <div class="clr"/></div>
      <div class="wrapper">';

Sir Osis of Liver



If anyone can do this in index.css, I'd like to see it.  Can float right or left, and set fixed margins, but cannot center it (margin: auto doesn't work). >:(

Here's a crappy inline hack you can use -

In index.template.php:



/// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;


echo'
<div id="navigation">
<div class="wrapper" align="center">
<div style="display: inline-block;">
<ul>';

foreach ($context['menu_buttons'] as $act => $button)
echo '<li><a href="', $button['href'], '">', $button['title'], '</a></li>';

echo'
</ul>
</div></div></div>';
}



Yeah, I know it's deprecated, but it werks gud.

When in Emor, do as the Snamors.
                              - D. Lister

Devicon

Thanks man, it worked great.


Jeremy M.

Quote from: Krash. on August 16, 2012, 03:17:41 PM


If anyone can do this in index.css, I'd like to see it.  Can float right or left, and set fixed margins, but cannot center it (margin: auto doesn't work). >:(

Here's a crappy inline hack you can use -

In index.template.php:



/// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;


echo'
<div id="navigation">
<div class="wrapper" align="center">
<div style="display: inline-block;">
<ul>';

foreach ($context['menu_buttons'] as $act => $button)
echo '<li><a href="', $button['href'], '">', $button['title'], '</a></li>';

echo'
</ul>
</div></div></div>';
}



Yeah, I know it's deprecated, but it werks gud.

doesn't work for me. I have 2.0.4

Sir Osis of Liver


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

When in Emor, do as the Snamors.
                              - D. Lister

Advertisement: