炫浪网首页 | 加入收藏夹 登录 | 注册
logo
网站导航: 炫浪首页游戏频道女性风采科技学院精品素材桌面壁纸BT影视网络社区健康生活
热门栏目: 炫友贴图编程开发硬件学堂博客空间游戏攻略游戏资源时尚女性美容护肤教程下载
炫浪(科技.学院)
 | 网站首页 | 系统软件 | 图形图像 | 编程开发 | 网络应用 | 硬件学堂 | 办公应用 | 〖图书馆〗 | 
  您现在的位置: 炫浪学院 >> 编程开发 >> 网页制作 >> HTMLCSS >> 正文

5款纯div+css制作的弹出菜单(标准且无js)

炫浪 科技.学院 时间:2007-8-20 13:16:07 来源:炫浪学院 发表评论 社区讨论

一、最基本的:二级dropdown弹出菜单
<!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=utf-8" />
<title>二级dropdown弹出菜单--A CROSS BROWSER DROP DOWN CASCADING VALIDATING MENU</title>
<style type="text/css">
/* common styling */
/* set up the overall width of the menu div, the font and the margins */

.menu {
font-family: arial, sans-serif;
width:750px;
margin:0;
margin:50px 0;
}
/* remove the bullets and set the margin and padding to zero for the unordered list */
.menu ul {
padding:0;
margin:0;
list-style-type: none;
}
/* float the list so that the items are in a line and their position relative so that the drop down list will appear in the right place underneath each list item */
.menu ul li {
float:left;
position:relative;
}
/* style the links to be 104px wide by 30px high with a top and right border 1px solid white. Set the background color and the font size. */
.menu ul li a, .menu ul li a:visited {
display:block;
text-align:center;
text-decoration:none;
width:104px;
height:30px;
color:#000;
border:1px solid #fff;
border-width:1px 1px 0 0;
background:#c9c9a7;
line-height:30px;
font-size:11px;
}
/* make the dropdown ul invisible */
.menu ul li ul {
display: none;
}

/* specific to non IE browsers */
/* set the background and foreground color of the main menu li on hover */
.menu ul li:hover a {
color:#fff;
background:#b3ab79;
}
/* make the sub menu ul visible and position it beneath the main menu list item */
.menu ul li:hover ul {
display:block;
position:absolute;
top:31px;
left:0;
width:105px;
}
/* style the background and foreground color of the submenu links */
.menu ul li:hover ul li a {
display:block;
background:#faeec7;
color:#000;
}
/* style the background and forground colors of the links on hover */
.menu ul li:hover ul li a:hover {
background:#dfc184;
color:#000;
}

</style>
<!--[if lte IE 6]>

<style type="text/css">
/* styling specific to Internet Explorer IE5.5 and IE6. Yet to see if IE7 handles li:hover */

/* Get rid of any default table style */
table {
border-collapse:collapse;
margin:0;
padding:0;
}
/* ignore the link used by 'other browsers' */
.menu ul li a.hide, .menu ul li a:visited.hide {
display:none;
}
/* set the background and foreground color of the main menu link on hover */
.menu ul li a:hover {
color:#fff;
background:#b3ab79;
}
/* make the sub menu ul visible and position it beneath the main menu list item */
.menu ul li a:hover ul {
display:b

[1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ... 下一页  >> 

  • 上一篇文章:

  • 下一篇文章:
  • 发 表 评 论
    姓 名: 主 页:
    评 分: 1分 2分 3分 4分 5分
    内 容:
    频 道 推 荐

    优秀程序员的两大要

    信息时代如何成为一

    如何成为一名C++程序

    Java程序员认证模拟

    高级程序员级考试大

    初级程序员级考试大
    最 新 热 门
    相 关 文 章
    如何利用CSS堆定位元素位置
    带有图片预览功能的上传的HTML代码
    简单的CSS改进网站设计的三个技巧
    CSS尺寸对照表
    样式表中的权重 css优先权
    CSS元素命名常用关键字
    管理css css注释写法的例子
    如何在静态HTM页面中实现无刷新的更
    网页设计中相关css 背景学习代码
    CSS:清除浮动的最优方法
    相 关 新 贴
    广 告 展 示

    炫浪网 业务、广告:web#xvna.com (请将#换成@) 业务广告QQ 业务广告QQ2
    Copyright @ 2006-2007 All Right Reserved (主域名 xvna.com 粤ICP备07040110号)
    【声明】本网站部分内容属社区网友发布,本网站仅提供网友交流平台,但有权在本网站范围内引用、发布、转载来自论坛网友发布的内容。网友发布内容纯属个人行为,与本网站立场无关。本网站对于论坛网友发布的内容所引发的版权、署名权的异议及纠纷,不承担任何责任。其他媒体转载须事先与原作者和本网站联系。