Reply LinkBack Thread Tools Search this Thread
Old 29-11-2007, 18:30   #1 (permalink)
longisland6
stephen eighmey
 
Join Date: Oct 2006
Location: earth
Posts: 164
ul li hover state causes extra vertical white space

i've designed this page template, Member Portal - eLifeCare , ...
all is good, except that when i hover a second or third tier menu choice, it pushes down my footer about 5-10 pixels. this only occurs on ie for the pc (no mac testing yet, but it's vaild xhtml transitional). here's the css code below (for the ul li part of the stylesheet anyway...)... anyone have any ideas why this might be happening? thanks.


/*navigation lists............................................. .............................................*/








#navcontainer
{
margin: 0px 0px 4px 0px;
padding: 0px 0px 0px 0px;
height: 22px;
}


#navcontainer ul
{
border: 0;
margin: 0;
padding: 0;
list-style-type: none;
text-align: center;
}


#navcontainer ul li
{
display: list-item;
float: left;
text-align: center;
padding: 0;
margin: 0;
}


#navcontainer ul li a
{
background: #368ab7;
padding: 4px 10px 4px 10px;
margin: 0px 0px 0px 0px;
color: #ffffff;
text-decoration: none;
display: list-item;
text-align: center;
font: normal 10px/18px;
}


#navcontainer ul li a:hover
{
color: #ffffff;
background: #002e47;
}


#navcontainer a:active
{
color: #ffffff;
background: #9d9a3f;
}


#navcontainer li.activeTab a
{
color: #ffffff;
background: #9d9a3f;
}


#navcontainer ul li.dynamicArea1
{
float: right;
}


#navcontainer ul li.dynamicArea2
{
float: right;
color: #ffffff;
padding: 4px 10px 4px 10px;
margin: 0px 0px 0px 0px;
background: #008E55;
}












/*....................sub menu.....................*/









#navcontainer2
{
margin: 0px 0px 4px 0px;
padding: 0px 0px 0px 0px;
height: 22px;
}


#navcontainer2 ul
{
border: 0;
margin: 0;
padding: 0;
list-style-type: none;
text-align: center;
}


#navcontainer2 ul li
{
display: list-item;
float: left;
text-align: center;
padding: 0;
margin: 0;
}


#navcontainer2 ul li a
{
background: #3D9DD0;
border-style: solid;
border-color: c2c2c2;
border-width: 0px 0px 0px 0px;
padding: 4px 10px 4px 10px;
margin: 0px 0px 0px 0px;
color: #ffffff;
text-decoration: none;
display: list-item;
text-align: center;
font: normal 10px/18px;
}


#navcontainer2 ul li a:hover
{
color: #ffffff;
background: #002E47;
}


#navcontainer2 a:active
{
color: #ffffff;
background: #9D9A3F;
}


#navcontainer2 li.activeTab a
{
color: #ffffff;
background: #9d9a3f;
}


#navcontainer2 li#active a
{
color: #ffffff;
background: #9D9A3F;
}









/*....................sub sub menu.....................*/









#navcontainer3
{
margin: 0px 0px 4px 0px;
padding: 0px 0px 0px 0px;
height: 22px;
}

#navcontainer3 ul
{
border: 0;
margin: 0;
padding: 0;
list-style-type: none;
text-align: center;
}

#navcontainer3 ul li
{
display: list-item;
float: left;
text-align: center;
padding: 0;
margin: 0;
}

#navcontainer3 ul li a
{
background: #41A7DD;
border-style: solid;
border-color: c2c2c2;
border-width: 0px 0px 0px 0px;
padding: 4px 10px 4px 10px;
margin: 0px 0px 0px 0px;
color: #ffffff;
text-decoration: none;
display: list-item;
text-align: center;
font: normal 10px/18px;
}

#navcontainer3 ul li a:hover
{
color: #ffffff;
background: #002E47;
}


#navcontainer3 a:active
{
color: #ffffff;
background: #9D9A3F;
}


#navcontainer3 li.activeTab a
{
color: #ffffff;
background: #9d9a3f;
}


#navcontainer3 li#active a
{
color: #ffffff;
background: #9D9A3F;
}








/*content.......................................... ................................................*/
  Reply With Quote
Old 29-11-2007, 18:36   #2 (permalink)
pasky
big paw
 
pasky's Avatar
 
Join Date: Nov 2007
Location: Toronto
Posts: 165
Send a message via MSN to pasky Send a message via Yahoo to pasky
hi ... I was having the same problem just today ... I fixed one ul menu but the other one the only solution I had was to give the div that contains the list a fixed height by 1 to 2 px bigger than the text contained in it.
  Reply With Quote
Old 29-11-2007, 18:40   #3 (permalink)
pasky
big paw
 
pasky's Avatar
 
Join Date: Nov 2007
Location: Toronto
Posts: 165
Send a message via MSN to pasky Send a message via Yahoo to pasky
oh and another thing you might want to do is declare the font-family and font-size and font-color for all your a elements that might be a problem too.
  Reply With Quote
Old 29-11-2007, 23:18   #4 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,340
If I'm guessing right, you might be able to solve this by declaring a set width for your <li>s and your <a>s. Worked for me when I had a similar problem.

Also, your <li>s and <a>s should probably be display: block; not list-item. And there's no need to give everything a text-align. Once will suffice - there's a reason they're called Cascading Style Sheets!
  Reply With Quote
Old 30-11-2007, 08:01   #5 (permalink)
longisland6
stephen eighmey
 
Join Date: Oct 2006
Location: earth
Posts: 164
i initially had them set as block, not list-item... same issue. and if i set a fixed width, what happens if i have text in there that exceeds this length? thanks...

and pasky, font styling is set further up the page in my body tag.

Last edited by longisland6 : 30-11-2007 at 11:46.
  Reply With Quote
Old 01-12-2007, 17:04   #6 (permalink)
longisland6
stephen eighmey
 
Join Date: Oct 2006
Location: earth
Posts: 164
anyone else have any more ideas on this?
  Reply With Quote
Old 04-12-2007, 15:27   #7 (permalink)
longisland6
stephen eighmey
 
Join Date: Oct 2006
Location: earth
Posts: 164
Quote:
Originally Posted by longisland6
anyone else have any more ideas on this?

i fixed it by setting fixed widths, but to answer my own question, i set the width to be 100% and not fixed pixels.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8