开发者

How do I make a suckerfish/superfish CSS dropdown that sticks to the right hand side of the page?

开发者 https://www.devze.com 2022-12-31 20:08 出处:网络
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, instea

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号