You are here: CSS drop down menu - how to centre it? « HTML « IT news, forums, messages
CSS drop down menu - how to centre it?

Posted by John on 10/24/06 10:21

Hi

I have a dropdown menu. Standard HTML with ul and li.

The following code works except that the boxes are all left justified and I
would like them to be centred.
I've tried auto with margins and various permutations but cannot get the
boxes to center.
Any ideas.

div#navbar {width:100%; margin-left:auto; margin-right:auto;}
div#navbar ul {list-style:none; padding:0; margin:0;}
div#navbar li {float:left; margin:0em;}
div#navbar li a{background: url(background.gif) #fff bottom left repeat-x;
height:20px; line-height:20px; float:left; width:7em; display:block;
border: 0.1em solid #DCDCE9;
color:white; font-size:x-small; text-decoration:none;
text-align:center;font-family: Verdana, sans-serif;}
div#navbar li a {float:none} /* IE5-MAC*/
div#navbar li a:hover {font-weight:bold; color:#5101BC; background:white;}

Excuse the sloppy coding.

Regards
John

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация