Log in

View Full Version : Resolved One last thing with the menu



robin9000
02-05-2009, 03:13 AM
I know how to center the menu but how do I center the menu items?

http://www.robinsden.110mb.com/menuscripts/testpage.shtml

What I want to do is center my top items to the middle of the menu.

bluewalrus
02-05-2009, 03:29 AM
Try this


/*Top level list items*/
.jqueryslidemenu ul li{
text-align:center;
position: relative;
display: inline;
float:right
}

in jqueryslidemenu.css

robin9000
02-05-2009, 03:40 AM
I did as you said but it only aligned the text to the middle of the tabs or what every they are called. I would like to have the words align to the middle of the page.

bluewalrus
02-05-2009, 03:59 AM
Oh. That's the whole menu then. Try this in place of your current file


.jqueryslidemenu{
font: bold 12px Verdana;
background-image:url(../Images/menu.gif);
height:31px;
width: 100%;
}

.jqueryslidemenu ul{
margin: 0;
padding: 0;
list-style-type: none;
text-align:center;
}

/*Top level list items*/
.jqueryslidemenu ul li{
position: relative;
text-align:center;
display: inline-block;
}

/*Top level menu link items style*/
.jqueryslidemenu ul li a{
display:inline-block;
background-image:url(../Images/menu.gif); /*background of tabs (default state)*/
color: white;
padding: 8px 10px;
border-right: 1px solid #778;
color: #2d2b2b;
text-decoration: none;
}

* html .jqueryslidemenu ul li a{ /*IE6 hack to get sub menu links to behave correctly*/
display: inline-block;
}

.jqueryslidemenu ul li a:link, .jqueryslidemenu ul li a:visited{
color: white;
}

.jqueryslidemenu ul li a:hover{
background-image:url(../Images/menu2.gif); /*tab link background during hover state*/
color: white;
}

/*1st sub level menu*/
.jqueryslidemenu ul li ul{
position: absolute;
left: 0;
display: block;
visibility: hidden;
}

/*Sub level menu list items (undo style from Top level List Items)*/
.jqueryslidemenu ul li ul li{
display: list-item;
float: none;
}

/*All subsequent sub menu levels vertical offset after 1st level sub menu */
.jqueryslidemenu ul li ul li ul{
top: 0;
}

/* Sub level menu links style */
.jqueryslidemenu ul li ul li a{
font: normal 13px Verdana;
width: 160px; /*width of sub menus*/
padding: 5px;
margin: 0;
border-top-width: 0;
border-bottom: 0px solid gray;
}

.jqueryslidemenuz ul li ul li a:hover{ /*sub menus hover style*/
background: #eff9ff;
color: black;
}

/* ######### CSS classes applied to down and right arrow images ######### */

.downarrowclass{
position: absolute;
top: 12px;
right: 7px;
}

.rightarrowclass{
position: absolute;
top: 6px;
right: 5px;
}