如何在超链接顶部显示菜单项
我有一个超链接。将鼠标放在它上面时,我会在底部显示菜单。我想在顶部显示菜单。底部的菜单显示良好。我必须显示在顶部。如何以我显示在顶部的方式更改样式。
CSS:
.menudiv{
position:absolute;
top: -10px;
border: 1px solid #BBB;
border-bottom-width: 0;
font:normal 11px Verdana;
line-height:10px;
z-index:100;
background-color: white;
width: 75px;
visibility: hidden;
}
HTML:
<div id= "menu3" class="menudiv">
<a href ="test.php">test1</a>
<a href ="test1.php">test2</a>
</div>
<a href ="#" rel ="menu3">menu1</a>
这为超链接提供了一个下拉菜单,但它显示在底部。现在我需要在顶部显示超链接的菜单。
I have a hyperlink .On putting the Mouse over it Iam displaying the menu in the bottom . I want to display the Menu over the top.The menu at the bottom is displaying fine. I have to display on top.How can ichange the style in such way i display on top.
CSS:
.menudiv{
position:absolute;
top: -10px;
border: 1px solid #BBB;
border-bottom-width: 0;
font:normal 11px Verdana;
line-height:10px;
z-index:100;
background-color: white;
width: 75px;
visibility: hidden;
}
HTML:
<div id= "menu3" class="menudiv">
<a href ="test.php">test1</a>
<a href ="test1.php">test2</a>
</div>
<a href ="#" rel ="menu3">menu1</a>
This providdes a drop down menu for hyperlink but it is displaying at bottom.Now i need to display the menu on top for the hyperlink.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
认为你的菜单高度是 40px;所以你可以为此设置
.menudiv
的底部;看:think your menu height is 40px; so you can set the bottom of
.menudiv
for this; look:好吧,我假设您在或不指定,position:relative
的容器中拥有此菜单。如果是这种情况,并且您想向上显示菜单,则需要将底部属性指定为 100%。您还需要为此创建一个容器
http://jsfiddle.net/wbVLF/
HTML:
CSS:
Ok so I assume you have this menu in a container that isor notposition:relative
. If that's the case and you want to display the menu upward you need to specify the bottom attribute as 100%.You need to make a container for this as well
http://jsfiddle.net/wbVLF/
HTML:
CSS: