CSS下拉菜单消失

时间:2013-02-26 19:42:57

标签: css drop-down-menu

http://nqmedia.co.uk/

当我滚动个人时,选项似乎很快消失了。

我认为它与造型有关

这是我的代码:

.topmenu {float: right; width: 710px; height: 45px; background-color: #3a5a93; margin-top: 50px; border-top-left-radius: 10px 15px;border-top-right-radius: 10px 15px; border-bottom-left-radius: 10px 15px; border-bottom-right-radius: 10px 15px;}
.topmenu ul li {padding-top: 10px; float: left; margin-left: 10px;}
.topmenu ul li a:link {padding: 10px 20px; font: 14px genevaregular; color: #fff; text-decoration: none;}
.topmenu ul li a:visited {padding: 10px 20px; font: 14px genevaregular; color: #fff; text-decoration: none;}
.topmenu ul li a:hover {padding: 10px 20px; font: 14px genevaregular; color: #fff; text-decoration: none;}
.topmenu ul li a:active {padding: 10px 20px; font: 14px genevaregular; color: #fff; text-decoration: none;}
.topmenu ul li.current-menu-item a {color: #fff; }
.topmenu ul ul li {background-color: #3a5a93; padding:10px;float: none;}
.topmenu ul ul li:hover {background-color: #637ead; }
.topmenu ul ul {display: none; position: absolute; margin-top: 12px;}
.topmenu ul li:hover > ul {display: block;}
.topmenu ul ul li a {padding: 10px;}

1 个答案:

答案 0 :(得分:2)

只需将position: absolute;上的.topmenu ul ul更改为position: relative;即可按预期工作。