HTML&CSS----练习隐藏导航栏(三级导航)
<!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>无标题文档</title>
<style type="text/css">
*
{
margin:0px;
padding:0px;}
#aa
{
height:40px;
width:90px;
top:80px;
left:200px;
background-color:#339;
position:absolute;
overflow:hidden;
text-align:center;
line-height:40px;
}
#bb
{
height:120px;
width:90px;
top:40px;
left:0px;
background-color:#3FC;
position:absolute;
}
table
{
height:120px;
width:90px;
border:0px;
text-align:center;
}
#cc
{
height:40px;
width:90px;
position:absolute;
left:0px;
top:0px;
overflow:hidden;
background-color:#6F6; }
#dd
{
height:40px;
width:90px;
background-color:#666;
position:absolute;
left:90px;
top:0px; }
#ee
{
height:40px;
width:90px;
position:absolute;
left:0px;
top:40px;
overflow:hidden;
background-color:#6F9; }
#ff
{
height:40px;
width:90px;
background-color:#666;
position:absolute;
left:90px;
top:0px; }
#gg
{
height:40px;
width:90px;
position:absolute;
left:0px;
top:80px;
overflow:hidden;
background-color:#F99; }
#hh
{
height:40px;
width:90px;
background-color:#666;
position:absolute;
left:90px;
top:0px; }
</style>
</head>
<body>
<div id="aa" onmouseover="over()" onmouseout="out()">新闻动态
<div id="bb">
<table cellpadding="0" cellspacing="0">
<tr>
<td height="40px" width="90px">
<div id="cc" onmouseover="over1()" onmouseout="out1()">场景
<div id="dd">讲座</div></div></td></tr>
<tr><td height="40px" width="90px"><div id="ee" onmouseover="over2()" onmouseout="out2()">活动<div id="ff">比赛</div></div></td></tr>
<tr><td height="40px" width="90px"><div id="gg" onmouseover="over3()" onmouseout="out3()">杂谈<div id="hh">项目</div></div></td></tr>
</table> <script>
function over()
{
var a = document.getElementById("aa");
a.setAttribute("style","overflow:visible;background-color:yellow");}
function out()
{
var a = document.getElementById("aa");
a.setAttribute("style","overflow:hidden");
}
function over1()
{
var a = document.getElementById("cc");
a.setAttribute("style","overflow:visible;background-color:green");}
function out1()
{
var a = document.getElementById("cc");
a.setAttribute("style","overflow:hidden");
}
function over2()
{
var a = document.getElementById("ee");
a.setAttribute("style","overflow:visible;background-color:yellow");}
function out2()
{
var a = document.getElementById("ee");
a.setAttribute("style","overflow:hidden");
}
function over3()
{
var a = document.getElementById("gg");
a.setAttribute("style","overflow:visible;background-color:red");}
function out3()
{
var a = document.getElementById("gg");
a.setAttribute("style","overflow:hidden");
}
</script>
</div></div>
</body>
</html>
显示效果:
鼠标没有指向时:

鼠标指向“新闻动态”时:

鼠标指向“场景”时:

鼠标指向“活动”时:

鼠标指向“杂谈”时:

HTML&CSS----练习隐藏导航栏(三级导航)的更多相关文章
- 纯洁CSS实现下拉菜单和下拉容器(纯洁CSS导航栏和导航下拉容器)
虽然网上课程似即使案件大同小异,但我还是写,记笔记,也为您提供参考 我希望你能指导批评~~ 首先,我们必须列出ul li 开始我们的导航栏菜单也能说生产: 在下面的页面,我们先建XHTML结构体: & ...
- 微信小程序 自定义头部导航栏和导航栏背景图片 navigationStyle
这两天因为要做一个带背景的小程序头,哭了,小程序导航栏有背景也就算了,还得让导航栏上的背景顺下来,心态小崩.现在可以单独设置一个页面的小程序头了,但是前提是要微信7.0以上的版本,考虑到兼容性问题 ...
- React实现顶部固定滑动式导航栏(导航条下拉一定像素时显示原导航栏样式)
摘要 基于react的框架开发一个顶部固定滑动式的酷炫导航栏,当导航栏置顶时,导航栏沉浸在背景图片里:当鼠标滑动滚轮时,导航栏固定滑动并展示下拉样式. JS部分 相关技术栈:react.antd.re ...
- CSS 导航栏
实例: 导航栏 Home News Articles Forum Contact About 导航栏 熟练使用导航栏,对于任何网站都非常重要. 使用CSS你可以转换成好看的导航栏而不是枯燥的HTML菜 ...
- CSS 笔记——导航栏、下拉菜单、提示工具
8. 导航栏.下拉菜单.提示工具 (1)导航栏 垂直导航栏 <!DOCTYPE html> <html lang="en"> <head> &l ...
- CSS:CSS 导航栏
ylbtech-CSS:CSS 导航栏 1.返回顶部 1. CSS 导航栏 导航栏 熟练使用导航栏,对于任何网站都非常重要. 使用CSS你可以转换成好看的导航栏而不是枯燥的HTML菜单. 导航栏=链接 ...
- HTML&CSS基础学习笔记1.11—导航栏
上文我们介绍到的<a>标签,由于<a>标签可以用来跳转,所以我们可以拿<a>标签来生成网页的导航栏. 其实在实际运用中,<a>标签就经常会被用来生成导航 ...
- zhuang 定制iOS 7中的导航栏和状态栏
近期,跟大多数开发者一样,我也正忙于对程序进行升级以适配iOS 7.最新的iOS 7外观上有大量的改动.从开发者的角度来看,导航栏和状态栏就发生了明显的变化.状态栏现在是半透明的了,这也就意味着导航栏 ...
- 【原创+译文】官方文档中声明的如何创建抽屉导航栏(Navigation Drawer)
如需转载请注明出处:http://www.cnblogs.com/ghylzwsb/p/5831759.html 创建一个抽屉导航栏 抽屉式导航栏是显示在屏幕的左边缘,它是应用程序的主导航选项面板.它 ...
- iOS 7 教程:定制iOS 7中的导航栏和状态栏
目录(?)[-] iOS 7中默认的导航栏 设置导航栏的背景颜色 在导航栏中使用背景图片 定制返回按钮的颜 修改导航栏标题的字体 修改导航栏标题为图片 添加多个按钮 修改状态栏的风格 隐藏状态栏 总结 ...
随机推荐
- jsp回车键登录代码
$("body").keydown(function(event) { if (event.keyCode == "13") {// keyCode=13是回车 ...
- Shallow Size 和 Retained Size
所有包含Heap Profling功能的工具(MAT, Yourkit, JProfiler, TPTP等)都会使用到两个名词,一个是Shallow Size,另一个是 Retained Size. ...
- emmet中文文档 (转载)
Emmet的前身是大名鼎鼎的Zen coding,如果你从事Web前端开发的话,对该插件一定不会陌生.它使用仿CSS选择器的语法来生成代码,大大提高了HTML/CSS代码编写的速度,比如下面的演示: ...
- opencv学习笔记(六)直方图比较图片相似度
opencv学习笔记(六)直方图比较图片相似度 opencv提供了API来比较图片的相似程度,使我们很简单的就能对2个图片进行比较,这就是直方图的比较,直方图英文是histogram, 原理就是就是将 ...
- 数字型 、String字符串转换
Java代码 收藏代码 String str = "1,2,3,4,5,6" public int[] StringtoInt(String str) { int ret[] = ...
- TCP的长连接和短连接
TCP/IP是个协议组,可分为三个层次:网络层.传输层和应用层. 在网络层有IP协议.ICMP协议.ARP协议.RARP协议和BOOTP协议. 在传输层中有TCP协议与UDP协议. 在应用层有FTP. ...
- MakeFile中赋值
Makefile 中:= ?= += =的区别 在Makefile中我们经常看到 = := ?= +=这几个赋值运算符,那么他们有什么区别呢?我们来做个简单的实验 新建一个Makefile,内容为 ...
- PHP“Cannot use object of type stdClass as array” (php在调用json_decode从字符串对象生成json对象时的报错)
php再调用json_decode从字符串对象生成json对象时,如果使用[]操作符取数据,会得到下面的错误 错误:Cannot use object of type stdClass as arra ...
- 有哪些关于 Android 开发的博客值得订阅?
链接:http://www.zhihu.com/question/19788650/answer/60771437来源:知乎 Google 官方[Android Developers Blog](An ...
- ytu 1789:n皇后问题(水题,枚举)
n皇后问题 Time Limit: 1 Sec Memory Limit: 64 MB Special JudgeSubmit: 12 Solved: 3[Submit][Status][Web ...