PDA

View Full Version : Smooth Menu Centre Problem



poohster
01-10-2012, 05:59 PM
Hi all have read others having the same problem, just can not ge tthe menu in the centre of my page have

.ddsmoothmenu{
font: italic normal 15px Georgia;
background: #ffffff;
width: 95%;
float: center;
color: #AEBBBF;

but still wont work is there anything else i need to change. :confused:

thanks

davelf
01-12-2012, 04:52 AM
any link or screenshot that you can provide? we need to see the web layout.


float: center;
this is wrong man, the value for float is left, right, none or inherit.

poohster
01-12-2012, 01:22 PM
Ok thanks tried them all and noone of them center the menu :(

davelf
01-13-2012, 03:32 AM
we can't help you if there's no link or screenshot

ddadmin
01-13-2012, 08:51 AM
Warning: Please include a link to the DD script in question in your post. See this thread (http://www.dynamicdrive.com/forums/showthread.php?t=6) for the proper posting format when asking a question.

URL: http://www.dynamicdrive.com/dynamicindex1/ddsmoothmenu.htm

If you mean center the entire bar relative to the page, try using "margin:auto":


.ddsmoothmenu{
font: bold 12px Verdana;
background: #414141; /*background of menu bar (default state)*/
width: 95%;
margin:auto;
}

poohster
01-13-2012, 03:44 PM
Sorry I thought you just had to put the title :o the script is





.ddsmoothmenu{
font: italic normal 15px Georgia;
background: white; /*background of menu bar (default state)*/
width: 100%;
}

.ddsmoothmenu ul{
z-index:100;
margin: 0;
padding: 0;
list-style-type: none;
}

/*Top level list items*/
.ddsmoothmenu ul li{
position: relative;
display: inline;
float: left;
}

/*Top level menu link items style*/
.ddsmoothmenu ul li a{
display: block;
background: white; /*background of menu items (default state)*/
color: white;
padding: 2px 21px;
border-right: 0;
color: #2d2b2b;
text-decoration: none;
}

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

.ddsmoothmenu ul li a:link, .ddsmoothmenu ul li a:visited{
color: #9DAEB3;
font-family: Georgia;
font-size: 15px;
font-style: italic;

}

.ddsmoothmenu ul li a.selected{
background: white;
color: #cccccc;
font-family: Georgia;
font-size: 15px;
font-style: italic;

}

.ddsmoothmenu ul li a:hover{
background: white;
color: #9C8652;
font-family: Georgia;
font-size: 15px;
font-style: italic;

}

/*1st sub level menu*/
.ddsmoothmenu ul li ul{
position: absolute;
left: 0;
display: none; /*collapse all sub menus to begin with*/
visibility: hidden;
}

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

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

/* Sub level menu links style */
.ddsmoothmenu ul li ul li a{
font: italic normal 15px Georgia;
width: 200px; /*width of sub menus*/
padding: 5px;
margin: 0;
border-top-width: 0;
border-bottom: 0;
}

/* Holly Hack for IE \*/
* html .ddsmoothmenu{height: 1%;} /*Holly Hack for IE7 and below*/


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

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

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

/* ######### CSS for shadow added to sub menus ######### */

.ddshadow{ /*shadow for NON CSS3 capable browsers*/
position: absolute;
left: 0;
top: 0;
width: 0;
height: 0;
background: white;
}

.toplevelshadow{ /*shadow opacity for NON CSS3 capable browsers. Doesn't work in IE*/
opacity: 0;
}


obviously I originaly added float center and margin auto, read on here some where but may of been a different script, but they havnt worked anyway so have removed them but its still stuck to the left :confused:

ddadmin
01-13-2012, 05:44 PM
Using margin:auto does center the entire bar relative to the page, though not the individual top menu items relative to the bar. Are you trying to accomplish the later?

poohster
01-13-2012, 09:45 PM
im trying to center the whole thing, have tried that and it doesnt work :o(