导航栏nav案例

Posted fanting

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了导航栏nav案例相关的知识,希望对你有一定的参考价值。

技术分享图片

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<style type="text/css" src="../css"></style>
<style>
html{
width: 100%;
height: 100%;
}
body{
width: 100%;
height: 100%;
}
.style_col_md{
font-size: 20px;
color: #966334;
text-align: center;
padding: 0px;
position: relative;
width: 17%;
height: 100px;
line-height: 100px;
}
.head_body_below{
text-align: center;
position: relative;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 1200px;
margin: 0 auto;
height: 100px;
background-color: #FFF8EB;
}
.title_style{
height: 35px;
padding: 0px;

}
.style_ul{
list-style-type:none;
padding: 0px;
background-color: #FFF8EB;
display: none;
position: absolute;
top:20px;
width:90%;
left:4px;
z-index:99;
margin-top: 80px;
opacity: 0.8;

}
.style_ul li{
line-height: 55px;
width: 100%;
}
#style_title_a{
color:#956034;
font-weight: bold;
text-decoration: none;
}
#style_title_a:hover{
color:#00A09D;
}
#style_hr{
color:#C4A384;
}
.home_body_top{
width: 100%;
}
#item_style_img{
width:100%;
height:100%;
}
#home_Gn{
background-color: #FFF8EE;
height: 200px;
border-bottom: 2px solid #CCC6BD;
}
.home_style_img{
width: 100%;
height: 90%;
text-align: center;
}
.home_style_img_title{
width: 100%;
height: 10%;
text-align: center;
margin-top: 10px;
}
#img_style_a{
text-decoration: none;
font-size: 18px;
}
#img_style_a:hover{
color:#00A09D;

}
.foot_info_top a{
color:white;
text-decoration: none;
font-size: 12px;
}
.foot_info_center{
text-align:center;
letter-spacing:2px;
margin-top:10px;
color:white;
}
.style_border{
background-color: #F4E8D8;
height: 600px;
}
.style_span{
font-weight: bold;
font-size: 18px;
color:#936235;
margin-top: 20px;
margin-left:20px;
float: left;
}
.style_All_a{
margin-top: 20px;
font-size: 16px;
text-align:right;
}
.style_All_a_style:hover{
color: #936235;
text-decoration: none;
}
.gn_style_img{
width: 80%
}

.news{
width:250px;
height:230px;
}
.san{
position: relative;
}

.gn_style_img{
width: 50%;
}
#style_a{
color: black;
text-decoration: none;
font-size: 16px;

}
#style_a:hover{
color: #00A09D;
}
</style>
<body>
<div class=‘row head_body_below‘>
<div class="col-md-1 col-sm-1 style_col_md">
<a id=‘style_title_a‘ href=‘‘>首页</a>
</div>
<div class="col-md-1 col-sm-1 style_col_md">
<div class=‘title_style‘>
<a id=‘style_title_a‘ href=‘‘> 院区概览</a>
</div>
<ul class=‘style_ul‘>
<li><a id=‘style_a‘ href=‘‘>医院简介</a></li>
<li><a id=‘style_a‘ href=‘‘>院领导介绍</a></li>
<li><a id=‘style_a‘ href=‘‘>组织架构</a></li>
</ul>
</div>
<div class="col-md-1 col-sm-1 style_col_md">
<div class=‘title_style‘>
<a id=‘style_title_a‘ href=‘‘> 科室导览</a>
</div>
<ul class=‘style_ul‘>
<li><a id=‘style_a‘ href=‘‘>科室介绍</a></li>
<li><a id=‘style_a‘ href=‘‘>门诊时间</a></li>
</ul>
</div>
<div class="col-md-1 col-sm-1 style_col_md">
<div class=‘title_style‘>
<a id=‘style_title_a‘ href=‘‘> 医院新闻</a>
</div>
<ul class=‘style_ul‘>
<li><a id=‘style_a‘ href=‘‘>医院动态</a></li>
</ul>
</div>
<div class="col-md-1 col-sm-1 style_col_md">
<div class=‘title_style‘>
<a id=‘style_title_a‘ href=‘#‘> 医师风采</a>
</div>
<ul class=‘style_ul‘>
<li><a id=‘style_a‘ href=‘expertteam.jsp?type=0‘>医师风采</a></li>
<li><a id=‘style_a‘ href=‘expertteam.jsp?type=1‘>专家介绍</a></li>
<li><a id=‘style_a‘ href=‘expertteam.jsp?type=2‘>名医介绍</a></li>
</ul>
</div>
<div class="col-md-1 col-sm-1 style_col_md">
<div class=‘title_style border_style‘>
<a id=‘style_title_a‘ href=‘#‘> 服务指南</a>
</div>
<ul class=‘style_ul‘>
<li><a id=‘style_a‘ href=‘#‘>门诊指南</a></li>
<li><a id=‘style_a‘ href=‘#‘>住院指南</a></li>
<li><a id=‘style_a‘ href=‘#‘>交通指南</a></li>
<li><a id=‘style_a‘ href=‘#‘>体检指南</a></li>
</ul>
</div>
</div>
</body>
</html>
<script type="text/javascript" src="js/jquery-2.1.1.min.js" ></script>
<script>
$(function(){
titleclick();
})
//导航栏移入移除
function titleclick(){
var sc = document.getElementsByClassName(‘style_col_md‘);
for (var i = 0; i < sc.length; i++) {
sc[i].addEventListener("mouseenter",function(){
$(this).children("ul").css("display","block");
})
sc[i].addEventListener("mouseleave",function(){
$(this).children("ul").css("display","none");
});
}
}
</script>




































































































































































































































以上是关于导航栏nav案例的主要内容,如果未能解决你的问题,请参考以下文章

超链接导航栏案例

超链接导航栏案例

CSSCSS 背景设置 ⑧ ( 背景设置案例 | 导航栏按钮 )

请问如何设置bootstrap导航栏中的菜单项居中均匀分布?谢谢

导航栏监听页面滚动跟随 简单封装

uniapp实战笔记使用uni-nav-bar自定义顶部状态栏和导航栏