Log in

View Full Version : Solid Block Menu - I wnat to make it centered, it is possible?



edukaos
02-11-2008, 11:38 PM
I need to make the Solid Block Menu http://www.dynamicdrive.com/style/csslibrary/item/solid-block-menu/
Centered, any help?
Thanks in advance

Nile
02-12-2008, 12:49 AM
Change:

<ul class="solidblockmenu">
To:

<ul class="solidblockmenu" align="center">

edukaos
02-12-2008, 01:06 AM
Thanks for the answer, but it doesnŽt work

Nile
02-12-2008, 01:11 AM
You want the links in
the center of the menu?
Or the menu in the center of the page?

boogyman
02-12-2008, 01:41 AM
html


<ul class="solidblockmenu">
<li><a href="http://www.dynamicdrive.com/">Home</a></li>
<li><a href="http://www.dynamicdrive.com/style/" class="current">CSS Examples</a></li>
<li><a href="http://www.dynamicdrive.com/forums/">Forums</a></li>
<li><a href="http://tools.dynamicdrive.com">Webmaster Tools</a></li>
<li><a href="http://www.javascriptkit.com/">JavaScript</a></li>
<li><a href="http://www.cssdrive.com">Gallery</a></li>
</ul>


css


.solidblockmenu{
margin: 0;
padding: 0;
float: left;
font: bold 13px Arial;
width: 100%;
border: 1px solid #625e00;
border-width: 1px 0;
background: black url(media/blockdefault.gif) center center repeat-x;
}

.solidblockmenu li{
display: inline;
}

.solidblockmenu li a{
float: left;
color: white;
padding: 9px 11px;
text-decoration: none;
border-right: 1px solid white;
}


To center the whole menu you first need to remove the reference to float: left from the first element, then you need to do some margin / alignment work


ul.solidblockmenu{
margin: 0 auto;
text-align: center;
width: 100%;
}


you then need to make sure that the bullets are not on the left side of the elements and you want to keep the code already being used in as the list item to display the menu horizontally.


ul.solidblockmenu li {
display: inline;
list-style-type: none;
text-align: left;
}

if that is not what you were looking for please explain more in-depth what you are attempting to accomplish

edukaos
02-13-2008, 07:51 PM
Thank a lot, IŽll try it today, and let you know later...