简体   繁体   English

使用HTML和CSS的鼠标悬停导航下拉菜单

[英]Mouse-over Navigation Dropdown Menu Using HTML and CSS

I would like to ask, if there is any way to develop a mouse-over dropdown menue using CSS and HTML, because I have seen before some websites like google for example developed such menus and it seems that once you pass through it a hidden tag gonna be visible to you. 我想问一下,是否有使用CSS和HTML开发鼠标悬停下拉菜单的方法,因为我之前曾见过像google这样的某些网站开发过这样的菜单,并且似乎一旦您通过它,便会隐藏标签将对您可见。

Please if any one have an idea, provide a source code of that idea 如果有任何想法,请提供该想法的源代码

Thanks and regards 谢谢并恭祝安康

This is referred to a CSS hover menu. 这称为CSS悬停菜单。 They're a great alternative to using JavaScript. 它们是使用JavaScript的绝佳选择。

Sample implementation: 实施示例:

.trigger ul.menu
{
    display: none;
}
.trigger:hover ul.menu
{
    display: block;
}

Sample Tutorial: http://www.shingokko.com/blog-entry/pure-css-hover-menu.html 示例教程: http : //www.shingokko.com/blog-entry/pure-css-hover-menu.html

Contrary to other answers, this method is cross-browser compatible. 与其他答案相反,此方法跨浏览器兼容。 If implemented correctly, it will work just fine in IE6+ (Source) . 如果实施正确,它将在IE6 + (源)中正常工作。

I don't think I can explain it better than this: http://www.htmldog.com/articles/suckerfish/dropdowns/ 我认为我无法对此做出更好的解释: http : //www.htmldog.com/articles/suckerfish/dropdowns/

That's what's known as "Son of Suckerfish Dropdowns". 那就是所谓的“ Suckerfish Dropdowns之子”。 It should get you going on the right direction. 它应该使您朝正确的方向前进。 Do be aware that CSS-only dropdowns won't work in IE 6 and older. 请注意,仅CSS下拉菜单在IE 6及更低版本中不起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM