I can’t get padding on my submenu, I can’t get the text to vertical align to the middle for the life of me either. I figured if I could set a background and font color then why wouldn’t padding or valign work either?
The only thing I can think of is maybe there is something overriding it possibly? Not sure.
Hi,
I would suggest that you remove the heights and any large line-heights on the sub li a, it causes to many problems when text needs to wrap. That can be from you needing a long string of text or the user increasing font-size.
I added the words “Wrapping Text” to the third sub li so you can see what the fixed height does. It’ better to use padding on the sub a like you mentioned.
If you look at This Example you will see how text will wrap nicely without heights and large line-heights on the sub li.
The padding is also what keeps the text looking vertically centered.
Also are you saying v-align doesnt work with a fixed height? If so that’s pretty dumb.
Vertical-align only applies to inline elements and tables, it has no effect on blocks/floats.
One more thing, the drop down menu is suppose to slide back up, I had a working version of it using just text, but i didn’t know if it wasn’t working correctly because I’m using a sprite?
Yes it is acting buggy, if you drag your cursor down the “y” in “Polysonmogrpahy” you can see the sub list trying to slide back up.
This may have something to do with you on applying the sub UL styles on hover. The hover should just be controlling the hide and show effects, not presenting the initial rules.
/* Make submenu not appear until hover is initiated */
.sub{margin-left: -9999em;}
/* This is how the submenu <ul> will be displayed */
#nav li:hover ul{
display:block;
position:absolute;
background-color:#c01515;
margin:0;
}