Centre positioning

Post your questions and problem reports here.
Post Reply
realboyle
Posts: 3
Joined: Mon Nov 19, 2012 12:02 pm

Centre positioning

Post by realboyle »

My newly created Easy Buttons Menu looks great, BUT shows on the left of my web page.
What should I do to position the menu on the centre of my web page??
... sorry if this question has been answered previously :-)
User avatar
Aivars
Blumentals Software Developer
Posts: 2462
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Centre positioning

Post by Aivars »

The easiest way to do it is to insert the menu inside an element such as div and center this element.
Some tips on how to do it: http://www.w3schools.com/css/css_align.asp
Blumentals Software Programmer
realboyle
Posts: 3
Joined: Mon Nov 19, 2012 12:02 pm

Re: Centre positioning

Post by realboyle »

User avatar
Aivars
Blumentals Software Developer
Posts: 2462
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Centre positioning

Post by Aivars »

Change

Code: Select all

<ul id="mb79xhebul_table" class="mb79xhebul_menulist css_menu" style="width: 586px; height: 42px;">
to

Code: Select all

<ul id="mb79xhebul_table" class="mb79xhebul_menulist css_menu" style="width: 586px; height: 42px; margin-right: auto; margin-left: auto; display: block;">
and that will center your menu.
Blumentals Software Programmer
realboyle
Posts: 3
Joined: Mon Nov 19, 2012 12:02 pm

Re: Centre positioning

Post by realboyle »

Thank You Aivars, but it does not work in IE Explorer 9
Sorry for troubling you again ...
It is great in Chrome, Firefox and Safari, but NOT in IE Explorer !!
User avatar
Aivars
Blumentals Software Developer
Posts: 2462
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Centre positioning

Post by Aivars »

Didn't notice the page uses quirks mode... You can center the menu by inserting it inside center-aligned DIV like this:

Code: Select all

<div align="center">
  <ul ....
  ...
  </ul>
</div>
Remove the margins and everything you added before.

Note that nobody uses align attribute nowadays but since you're using quirks mode and you're using align attribute in the code anyway, this will center the menu.
Blumentals Software Programmer
Ken
Posts: 2
Joined: Sat Jul 13, 2013 1:26 pm

Re: Centre positioning

Post by Ken »

Aivars,

Thank you, thank you, thank you !!!! Works great :D

Ken
Post Reply