Pure css drop down menu without js ( if js is disabled) in IE 6?

坚强是说给别人听的谎言 提交于 2019-12-13 17:21:11

问题


I found many css/js menu scripts on various sites they work well is in FF, IE7 and safari, opera if JS is disabled but not in IE 6 and for IE 6 small js file need to add because IE doesnt support hover but my question is can we make pre css dropdown menu for IE6 because IE 6 support :hover on then can we make dropw down menu without javascript for IE6 and all other browsers. ?


回答1:


The only legit non-JS workaround albeit nasty is using conditionals and a table element:

http://www.cssplay.co.uk/menus/final_drop.html

Edit:

Actually there appears to be a new method from Stu which relies on a huge margin offset, plenty of explicit stacking order declarations, I think he's using some kind of float drop.

Seems to have been pioneered by either Paul O'B/Timo @ http://www.sitepoint.com/forums/showthread.php?t=635116&page=5

http://www.cssplay.co.uk/menus/new-dropdown.html




回答2:


It's not really feasible in IE6, because while IE6 supports :hover, it only supports it on link elements, nothing else. You could fall back to CSS expressions, but at that point you're essentially sending some custom Javascript to IE6, and CSS expressions tend to leak memory like nobody's business.




回答3:


You might consider using a CSS only solution like the one written by Steve Gibson of GRC.



来源:https://stackoverflow.com/questions/1604967/pure-css-drop-down-menu-without-js-if-js-is-disabled-in-ie-6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!