...

View Full Version : Css menu size increase



mj2010
07-08-2010, 07:17 PM
thats my script of html & css

..............HTML..................

<ul id="nav-top">
<li><a href="#">Software</a> &nbsp;&nbsp;|&nbsp;&nbsp;</li>
<li><a href="#">Your cart</a> &nbsp;&nbsp;|&nbsp;&nbsp;</li>
<li><a href="#">Solutions</a> &nbsp;&nbsp;|&nbsp;&nbsp;</li>
<li><a href="#">Products</a> &nbsp;&nbsp;|&nbsp;&nbsp;</li>
<li><a href="#">Contacts</a></li>
</ul>
......CSS.......

#nav-top {
position: absolute;
top: 17px;
left: 250px;
color: #fff;
width: 600px;
}

#nav-top li {
display: inline;
font-family: tahoma, helvetica, arial, sans-serif;
font-size: 10px;
width:75px;
position:static;
}

#nav-top a {
color: #fff;
font-weight: bold;
text-decoration: none;
font-family: tahoma, helvetica, arial, sans-serif;

}

#nav-top a:hover {
text-decoration: underline;
font-size:11px;
}

#nav-left {
position: absolute;
top: 66px; left: 26px;
}



I want that when mouse over on the menu's then there size increase
& it's happened
but the problem is that when the size increase of menu they all moves from their position
example....
i have 5 menus software | Your Cart | Solutions | Products | contacts
when i put my mouse on the one of them like i put my mouse on the software then it increase it size to 10px t0 11px and its already happen but all of the other menus moves
so what the solution of that i am currently learning css please help...
thanks ...
& sorry for my english

cjsingsaas
07-08-2010, 08:15 PM
You could try putting some sort of margin or padding on the left and right of each menu item. Then in the hover CSS - just have the margin or padding reduced. It would take some tweaking but you could mimic what you are looking for.

SB65
07-08-2010, 08:34 PM
Easier to set the menu item as a fixed width block element, then the text size increase (within reason) won't affect the width. Css something like:


#nav-top li {
display: block;
float:left;
font-family: tahoma, helvetica, arial, sans-serif;
font-size: 10px;
width:75px;
text-align:center;
border-right:1px solid white}

#nav-top li.last{
border:none}

with html:


<ul id="nav-top">
<li><a href="#">Software</a></li>
<li><a href="#">Your cart</a></li>
<li><a href="#">Solutions</a></li>
<li><a href="#">Products</a></li>
<li class="last"><a href="#">Contacts</a></li>
</ul>

which gets rid of all those nasty spaces, and uses border-left instead of a pipe



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum