纯CSS实现之简陋版
原理:通过无序列表实现一二级菜单,二级菜单display默认值为none;当鼠标经过时,二级菜单display值变为block。
<!DOCTYPE html>
<html><head>
<title>鼠标经过显示下拉菜单</title>
<style type="text/css">
.firstLevel {
list-style: none;
}
.secondLevel {
display: none;
}
#first1:hover ul, #first2:hover ul, #first3:hover ul {
display: block;