css3完成的多级别渐变色往下拉菜单导航栏实际效

日期:2020-09-21 类型:科技新闻 

关键词:微信小程序页面设计,python小程序,小程序首页模板,如何建立微信小程序,怎么做微信小程序

本文案例讲述了css3完成的多级别渐变色往下拉菜单导航栏实际效果编码。共享给大伙儿供大伙儿参照。实际以下:

这是1款根据css3完成的往下拉菜单导航栏,是是非非常好看的动漫菜单,并且是多级别菜单的方式,检测时发现可适用5级,估算还能够适用更多的子菜单项,仅有你想这么提升下去,CSS3完成的实际效果真的很棒,希望盆友们如今就赶紧学习培训1下CSS3吧,这些Demo毫无疑问会对你协助很大。

运作实际效果截图以下:

线上演试详细地址以下:

http://demo.jb51.net/js/2015/css3-jb-menu-nav-codes/

实际编码以下:


拷贝编码
编码以下:
<!DOCTYPE HTML>
<html lang=zh-cn>
<head>
<meta charset=utf⑻>
<title>css3往下拉菜单导航栏</title>
<style>
*{margin:0px;padding:0px;}
body{background:#b1b1b1;margin:0px;padding:0px;font-size:14px;color:#000;}
.tips{width:702px;margin:0 auto;line-height:24px;padding-top:10px;}
.bredcolor{color:#fff;}
#menu {width:700px;text-align:center;height:38px;background:#069;margin:50px auto 300px auto;padding:3px 6px;border-radius:6px;box-shadow:0 15px 10px ⑴5px rgba(0,0,0,0.5);}
#menu ul {margin:0;padding:0;list-style:none;white-space:nowrap;text-align:left;background:#069;}
#menu ul {display:inline-block;}
#menu li {margin:0;padding:0;list-style:none;}
#menu li {display:inline-block;display:inline;}
#menu ul ul {position:absolute;left:⑼999px;opacity:0;padding:3px 6px;border-radius:6px;box-shadow:0 15px 10px ⑴5px rgba(0,0,0,0.5);
-webkit-transition: opacity 1s;
-moz-transition: opacity 1s;
-ms-transition: opacity 1s;
-o-transition: opacity 1s;
transition: opacity 1s;
}
#menu ul.level1 {margin:0 auto;}
#menu ul.level1 li.level1-li {float:left;display:block;position:relative;}
#menu a {display:block;font:normal 12px tahoma, arial, 宋体b8b\4f53, sans-serif;color:#fff;line-height:30px;text-decoration:none;padding:0 20px 0 10px;margin:3px;background:#069;border:1px solid #09c;border-radius:3px;
background-image:-webkit-gradient(linear, 0 0, 0 100%, color-stop(0, rgba(255, 255, 255, 0.7)), color-stop(0.5, rgba(255, 255, 255, 0.2)), color-stop(0.5, transparent), to(rgba(255, 255, 255, 0.3)));
background-image:-moz-linear-gradient(top, rgba(255, 255, 255, 0.7) 0, rgba(255, 255, 255, 0.2) 50%, transparent 50%, rgba(255, 255, 255, 0.3) 100%);
background-image:-ms-linear-gradient(top, rgba(255, 255, 255, 0.7) 0, rgba(255, 255, 255, 0.2) 50%, transparent 50%, rgba(255, 255, 255, 0.3) 100%);
background-image:-o-linear-gradient(top, rgba(255, 255, 255, 0.7) 0, rgba(255, 255, 255, 0.2) 50%, transparent 50%, rgba(255, 255, 255, 0.3) 100%);
background-image:linear-gradient(top, rgba(255, 255, 255, 0.7) 0, rgba(255, 255, 255, 0.2) 50%, transparent 50%, rgba(255, 255, 255, 0.3) 100%);
-webkit-transition: 0.25s;
-moz-transition: 0.25s;
-ms-transition: 0.25s;
-o-transition: 0.25s;
transition: 0.25s;
}
#menu input {display:none;}
#menu label {display:block;font:normal 12px tahoma, arial, 宋体b8b\4f53, sans-serif;color:#fff;line-height:30px;padding:0 20px 0 10px;margin:3px;position:relative;background:#069;border:1px solid #09c;border-radius:3px;
background-image:-webkit-gradient(linear, 0 0, 0 100%, color-stop(0, rgba(255, 255, 255, 0.7)), color-stop(0.5, rgba(255, 255, 255, 0.2)), color-stop(0.5, transparent), to(rgba(255, 255, 255, 0.3)));
background-image:-moz-linear-gradient(top, rgba(255, 255, 255, 0.7) 0, rgba(255, 255, 255, 0.2) 50%, transparent 50%, rgba(255, 255, 255, 0.3) 100%);
background-image:-ms-linear-gradient(top, rgba(255, 255, 255, 0.7) 0, rgba(255, 255, 255, 0.2) 50%, transparent 50%, rgba(255, 255, 255, 0.3) 100%);
background-image:-o-linear-gradient(top, rgba(255, 255, 255, 0.7) 0, rgba(255, 255, 255, 0.2) 50%, transparent 50%, rgba(255, 255, 255, 0.3) 100%);
background-image:linear-gradient(top, rgba(255, 255, 255, 0.7) 0, rgba(255, 255, 255, 0.2) 50%, transparent 50%, rgba(255, 255, 255, 0.3) 100%);
-webkit-transition: 0.25s;
-moz-transition: 0.25s;
-ms-transition: 0.25s;
-o-transition: 0.25s;
transition: 0.25s;
}
#menu label img {position:absolute;left:0;top:0;width:100%;height:100%;}
#menu label b {color:#ff0;}
#menu ul.level1 li.level1-li a.level1-a {float:left;}
#menu input#tab1:checked ~ ul.level1 ul.ul1,
#menu input#tab2:checked ~ ul.level1 ul.ul2,
#menu input#tab3:checked ~ ul.level1 ul.ul3 {opacity:1;left:⑹px;top:50px;}
#menu input#tab4:checked ~ ul.level1 ul.ul4 {opacity:1;left:auto;right:0;top:50px;}
#menu input#tab2a:checked ~ ul.level1 ul.ul2,
#menu input#tab2b:checked ~ ul.level1 ul.ul2,
#menu input#tab2c:checked ~ ul.level1 ul.ul2,
#menu input#tab2aa:checked ~ ul.level1 ul.ul2 {opacity:1;left:⑹px;top:50px;}
#menu input#tab2a:checked ~ ul.level1 ul.ul2 ul.ul2a,
#menu input#tab2b:checked ~ ul.level1 ul.ul2 ul.ul2b,
#menu input#tab2c:checked ~ ul.level1 ul.ul2 ul.ul2c,
#menu input#tab2aa:checked ~ ul.level1 ul.ul2 ul.ul2a,
#menu input#tab2aa:checked ~ ul.level1 ul.ul2 ul.ul2a ul.ul2aa {opacity:1;left:100%;top:auto;margin-top:⑷0px;margin-left: 5px;}
#menu input#tab4a:checked ~ ul.level1 ul.ul4,
#menu input#tab4b:checked ~ ul.level1 ul.ul4,
#menu input#tab4aa:checked ~ ul.level1 ul.ul4 {opacity:1;left:auto;right:0;top:50px;}
#menu input#tab4a:checked ~ ul.level1 ul.ul4 ul.ul4a,
#menu input#tab4b:checked ~ ul.level1 ul.ul4 ul.ul4b,
#menu input#tab4aa:checked ~ ul.level1 ul.ul4 ul.ul4a,
#menu input#tab4aa:checked ~ ul.level1 ul.ul4 ul.ul4a ul.ul4aa {opacity:1;left:auto;right:100%;top:auto;margin-top:⑷0px;margin-right:5px;}
#menu li a:hover {border-color:#fff;}
#menu label.close {position:absolute;width:100%;height:30px;display:none;padding:0;left:0;top:0;border:0;background:transparent;}
#menu input#tab1:checked ~ ul.level1 label.lab1,
#menu input#tab2:checked ~ ul.level1 label.lab2,
#menu input#tab2a:checked ~ ul.level1 label.lab2,
#menu input#tab2b:checked ~ ul.level1 label.lab2,
#menu input#tab2c:checked ~ ul.level1 label.lab2,
#menu input#tab2aa:checked ~ ul.level1 label.lab2,
#menu input#tab3:checked ~ ul.level1 label.lab3,
#menu input#tab4:checked ~ ul.level1 label.lab4,
#menu input#tab4a:checked ~ ul.level1 label.lab4,
#menu input#tab4b:checked ~ ul.level1 label.lab4,
#menu input#tab4aa:checked ~ ul.level1 label.lab4 {display:block;}
</style>
</head>
<body>
<div id="menu">
<input type="radio" name="tab" id="tab1" class="tabs">
<input type="radio" name="tab" id="tab2" class="tabs">
<input type="radio" name="tab" id="tab2a" class="tabs">
<input type="radio" name="tab" id="tab2aa" class="tabs">
<input type="radio" name="tab" id="tab2ab" class="tabs">
<input type="radio" name="tab" id="tab2b" class="tabs">
<input type="radio" name="tab" id="tab2c" class="tabs">
<input type="radio" name="tab" id="tab3" class="tabs">
<input type="radio" name="tab" id="tab4" class="tabs">
<input type="radio" name="tab" id="tab4a" class="tabs">
<input type="radio" name="tab" id="tab4aa" class="tabs">
<input type="radio" name="tab" id="tab4b" class="tabs">
<input type="radio" name="tab" id="tabclose" class="tabs">
<ul class="level1">
<li class="level1-li"><a class="level1-a" href="#">首 页</a></li>
<li class="level1-li"><label for="tab1" class="open"><img src="images/trans.gif" alt="">有关我 <b>↓</b></label><label for="tabclose" class="close lab1"><img src="images/trans.gif" alt=""></label>
<ul class="ul1">
<li><a href="#">邮 箱</a></li>
<li><a href="#">电 话</a></li>
<li><a href="#">地 址</a></li>
</ul>
</li>
<li class="level1-li"><label for="tab2"><img src="images/trans.gif" alt="">度 假 <b>↓</b></label><label for="tabclose" class="close lab2"><img src="images/trans.gif" alt=""></label>
<ul class="ul2">
<li><a href="#">度假照片</a></li>
<li><label for="tab2a"><img src="images/trans.gif" alt="">度假店铺 <b>→</b></label>
<ul class="ul2a">
<li><a href="#">购物</a></li>
<li><a href="#">互联网技术市场销售</a></li>
<li><label for="tab2aa"><img src="images/trans.gif" alt="">购物圣地 <b>→</b></label>
<ul class="ul2aa">
<li><a href="#">考 验</a></li>
<li><a href="#">周边的</a></li>
<li><a href="#">具体指导书</a></li>
<li><a href="#">滑 板</a></li>
</ul>
</li>
<li><a href="#">权威专家详细介绍</a></li>
</ul>
</li>
<li><a href="#">趣味日常生活</a></li>
<li><label for="tab2b"><img src="images/trans.gif" alt="">餐 厅 <b>→</b></label>
<ul class="ul2b">
<li><a href="#">冬天宾馆</a></li>
<li><a href="#">夏天宾馆</a></li>
<li><a href="#">秋天宾馆</a></li>
<li><a href="#">冬天宾馆</a></li>
</ul>
</li>
<li><label for="tab2c"><img src="images/trans.gif" alt="">篝火晚会 <b>→</b></label>
<ul class="ul2c">
<li><a href="#">主题晚会</a></li>
<li><a href="#">报道晚会</a></li>
<li><a href="#">郊外晚会</a></li>
</ul>
</li>
</ul>
</li>
<li class="level1-li"><label for="tab3"><img src="images/trans.gif" alt="">景区周边自然环境 <b>↓</b></label><label for="tabclose" class="close lab3"><img src="images/trans.gif" alt=""></label>
<ul class="ul3">
<li><a href="#">为何去那</a></li>
<li><a href="#">大家做甚么</a></li>
<li><a href="#">风 景</a></li>
<li><a href="#">日常生活卡品</a></li>
</ul>
</li>
<li class="level1-li"><label for="tab4"><img src="images/trans.gif" alt="">动态性信息内容 <b>↓</b></label><label for="tabclose" class="close lab4"><img src="images/trans.gif" alt=""></label>
<ul class="ul4">
<li><a href="#">付款方式</a></li>
<li><label for="tab4a"><img src="images/trans.gif" alt=""><b>←</b> 掌握度假村</label>
<ul class="ul4a">
<li><a href="#">实质日常生活</a></li>
<li><a href="#">保 险</a></li>
<li><label for="tab4aa"><img src="images/trans.gif" alt=""><b>←</b> 便宜房租</label>
<ul class="ul4aa">
<li><a href="#">客 厅</a></li>
<li><a href="#">卧 室</a></li>
<li><a href="#">阳 台</a></li>
</ul>
</li><li><a href="#">周边院校</a></li>
<li><a href="#">学全球</a></li>
<li><a href="#">周边院校</a></li>
</ul>
</li>
<li><label for="tab4b"><img src="images/trans.gif" alt=""><b>←</b> 语 言</label>
<ul class="ul4b">
<li><a href="#">英 语</a></li>
<li><a href="#">中 文</a></li>
<li><a href="#">法 语</a></li>
</ul>
</li>
<li><a href="#">强大啊</a></li>
</ul>
</li>
<li class="level1-li"><a class="level1-a" href="#">全球观</a></li>
</ul>
</div>
</body>
</html>

期待本文所述对大伙儿的css3网页页面设计方案有一定的协助。