打印

[学习资料] 非脚本式下拉菜单[符合W3C标准,全兼容]

非脚本式下拉菜单[符合W3C标准,全兼容]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>颠覆传统观念---非脚本式下拉菜单[符合W3C标准,全兼容]</title>
<style>
.xd_menu {
      position:relative;
      background:#fff;
      color:#666;
      text-decoration:none;
      font-size:12px;
      width:200px;
      text-align:center;
      border:1px solid #ccc;
      height:30px;
      line-height:25px;
      z-index: 10;
      display: block;
      float: left;
      margin-left: 2px;
}/*设置链接的属性,一定要设置为relative才能使提示层跟着链接走*/
.xd_menu:hover {background:#eee;color:#333;}
.xd_menu span{display: none; }/*设置正常下的span为隐藏状态*/
.xd_menu:hover span{
      display:block;
      position:absolute;
      top:29px;
      left:-1px;
      width:130px;
      background:#eee;
      color:#000;
      text-align:left;
      border-right-width: 1px;
      border-bottom-width: 1px;
      border-left-width: 1px;
      border-right-style: solid;
      border-bottom-style: solid;
      border-left-style: solid;
      border-right-color: #CCCCCC;
      border-bottom-color: #CCCCCC;
      border-left-color: #CCCCCC;
      font-size: 12px;
      text-decoration: none;
}/*设置hover下的span属性为呈现状态,并设置提示层的位置*/
table a {
      color: #0066CC;
      color:#0066CC;
      text-align: center;
      vertical-align: middle;
      height: 20;
      width: 100%;
      text-decoration: none;
      text-decoration: none;
      font-size: 12px;
      display: block;
}
table a:visited {
      text-decoration: none;
      color: #009900;
      width: 100%;
}
table a:hover {
      text-decoration: underline;
      color: #FFFFFF;
      background-color: #0066CC;
      text-align: center;
      width: 100%;
}
table a:active {
      text-decoration: none;
      color: #999999;
}
table {      width: 100%;}
.xd_menu #table{display: none; }
.xd_menu:hover #table{
      display:block;
      position:absolute;
      top:25px;
      left:-1px;
      width:130px;
      background:#eee;
      color:#000;
      text-align:left;
      border-right-width: 1px;
      border-bottom-width: 1px;
      border-left-width: 1px;
      border-right-style: solid;
      border-bottom-style: solid;
      border-left-style: solid;
      border-right-color: #CCCCCC;
      border-bottom-color: #CCCCCC;
      border-left-color: #CCCCCC;
      font-size: 12px;
      text-decoration: none;
}
</style></head>
<body>
<a class="xd_menu" href="http://www.xlin.cn">菜单一<span>
<table border="0" cellpadding="0" cellspacing="0" >
<tr><td><a href="http://www.xlin.cn">www.xlin.cn1</a></td></tr>
<tr><td><a href="http://www.xlin.cn">www.xlin.cn1</a></td></tr>
<tr><td><a href="http://www.xlin.cn">www.xlin.cn1</a></td></tr></table></span>
</a>
<a class="xd_menu" href="http://www.xlin.cn">菜单二<span>
<table border="0" cellpadding="0" cellspacing="0" >
<tr><td><a href="http://www.xlin.cn">www.xlin.cn2</a></td></tr>
<tr><td><a href="http://www.xlin.cn">www.xlin.cn2</a></td></tr>
<tr><td><a href="http://www.xlin.cn">www.xlin.cn2</a></td></tr></table></span>
</a>
<a class="xd_menu" href="http://www.xlin.cn">菜单三<span>
<table border="0" cellpadding="0" cellspacing="0" >
<tr><td><a href="http://www.xlin.cn">www.xlin.cn3</a></td></tr>
<tr><td><a href="http://www.xlin.cn">www.xlin.cn3</a></td></tr>
<tr><td><a href="http://www.xlin.cn">www.xlin.cn3</a></td></tr></table></span>
</a>
</body>
</html>
天天烹饪   www.ttcook.cn

TOP

学习了
令人悲哀的是,当我们在睡梦中听到自己良心的呼唤时,却不能马上有所行动;而当我们在醒后能采取行动时,又忘记了在梦中的觉悟!

TOP

学习了

TOP

提示: 作者被禁止或删除 内容自动屏蔽

TOP

返回顶部
〖版权(C)〗归 精品边缘-SSOSO.COM 所有,Copyright By SSOSO.COM
Powered by Discuz! Copyright © 2008-2010 精品边缘.SSOSO.COM.
Please change your screen resolution to1024 x768

当前时区 GMT+8, 现在时间是 2008-8-30 04:25 浙ICP备06012320号    
清除 Cookies - 联系我们 - www.ssoso.com 精品边缘. - Archiver - WAP