I am developing a CSS dropdown menu based on the suckerfish CSS. I would like to put it on the right hand side of the page but the menus extend from the leftmost edge of each menu to the right, instead of from the rightmost edge of each menu to the left (as is necessary to keep the rightmost dropdown menu from opening outside the visible area.开发者_JAVA百科)
How do I position my suckerfish dropdown menus to extend to the left, instead of the right?
If you are using Son Of Suckerfish, you can change this line:
#nav li ul ul { /* third-and-above-level lists */
margin: -1em 0 0 10em;
}
to
#nav li ul ul { /* third-and-above-level lists */
margin: -1em 0 0 -10em;
}
This works because the 2nd- and 3rd-level menus have a defined width (of 10ems).
Use right
instead of left
, or use a negative value with strictly controlled widths.
精彩评论