0

For sub menu i am using position:absolute so that the submenu appears on the right of the main menu. However, with position:absolute the scroller is not appearing.

Is there any way i can make the scrollbar appear on the submenu after a certain height is reached?

Here is my css:

.main-navigation{
    float:left; position:relative; padding-left:3.071em; z-index:9999;
}
.main-navigation ul{ list-style:none; font-family:"Century Gothic";}
.main-navigation li{ text-transform:lowercase; display:block;}
.main-navigation li a{ 
    display:block; color:#000;line-height:18px; 
    padding:0 4em 0 1.429em;}

.main-navigation li ul{
    display:none; position:absolute; z-index:1; top:1px; left:90%;
}
    .main-navigation li ul li{
        line-height:18px; margin:0 1em 0.143em 0;
    }   
    .main-navigation li ul li a {
        display: inline-block;
        line-height:14px;
        padding: 0 2em;
        width: 10.429em; margin:0 0 0 1em;
        white-space: normal;        
    }

.submenu .current-menu-item a{ 
    background:url(images/current-page.png) no-repeat left; }

.main-navigation .current-menu-item > a,
.main-navigation .current-menu-ancestor > a,
.main-navigation .current_page_item > a,
.main-navigation .current_page_ancestor > a {
        background:url(images/current-page.png) no-repeat left;
    }

.sub-menu { height:80px; position:relative; display:block;}

.main-navigation li.current_page_item ul,
.main-navigation li.current_page_parent ul,
.main-navigation li.current_page_ancestor ul { display: block; }
4

1 回答 1

0

如果没有看到页面,或者至少是相关的 HTML,很难回答这样的问题。但也许你可以尝试这样的事情?

.sub-menu {height:80px; overflow: auto;}
于 2013-04-29T09:33:18.367 回答