


The example in this article describes the JS CSS code to implement the atmospheric black homepage navigation menu effect. Share it with everyone for your reference. The details are as follows:
This is an atmospheric heavy-color red high-contrast menu implemented in JS CSS. It can be used as a homepage navigation menu. From a design perspective, it is quite professional. From a practical perspective, It is widely used and is a classic style menu that everyone loves. It is a very good work.
A screenshot of the running effect is as follows:
The online demo address is as follows:
http://demo.jb51.net/ js/2015/js-css-black-style-nav-menu-codes/
The specific code is as follows:
<!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>大气的黑色CSS首页导航菜单</title> <style> body,div,form,ul,li,span{margin:0;padding:0; list-style-type:none;} body {text-align:center;color:#444;font-family:"宋体";font-size:12px; background:url(images/bodybg.jpg) top repeat-x;} img {border:0px;} .ml12{margin-left:12px; display:inline} a,a:Link,a:visited{font-size:12px;color:#444; text-decoration:none} a:hover{color:#FF3300; text-decoration:underline;} .nav{width:1000px;float:left} .nav ul{width:1000px;float:left;} .nav li{width:100px;float:left; height:38px; line-height:38px;margin-right:20px; display:inline;} .nav li a:link,.nav li a:visited{color:#E4E4E4;font-size:14px;font-weight:bold;} .nav li a:hover{ text-decoration:none;width:100px;float:left; height:38px; line-height:38px; background:url(images/home-bg.jpg)} /*主导航菜单*/ #menu ul{ padding:0; border:0; list-style:none; line-height:38px; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 15px; float:left; } #menu_out{ width:1000px;float:left; margin-top:107px; padding-left:3px; margin-left:auto; margin-right:auto; height:38px; overflow:hidden; } #menu_in{ padding-right:4px; } #menu{ height:38px; } #nav{ padding-left:20px; } #nav li{ float:left; height:38px; margin-left:5px;margin-right:5px; } #nav li a{ float:left; display:block; padding-left:6px; height:38px; cursor:pointer; text-decoration:none; text-align:center; } #nav li a span{ float:left; width:100px; line-height:38px; font-size:14px; font-weight:bold; color:#FFFFFF; text-decoration:none; text-align:center; } #nav li .nav_on{ /*鼠标经过时变换背景,方便JS获取样式*/ background-position:left 100%; } #nav li .nav_on span{ /*鼠标经过时变换背景,方便JS获取样式*/ background-position:right 100%; color:#fff; text-decoration:none; width:100px;background:url(images/home-bg.jpg) no-repeat; } .nav-bot{width:1000px;float:left; height:20px;overflow:hidden; line-height:20px; padding-top:12px; padding-bottom:10px;} .nav-botinfo{width:680px;background:url(images/ico01.jpg) no-repeat left;text-align:left;padding-left:20px; margin-left:10px; display:inline;color:#9F9F9F;} </style> <script type="text/javascript"> function qiehuan(num){ for(var id = 0;id<=7;id++) { if(id==num) { document.getElementById("qh_con"+id).style.display="block"; document.getElementById("mynav"+id).className="nav_on"; } else { document.getElementById("qh_con"+id).style.display="none"; document.getElementById("mynav"+id).className=""; } } } </script> </head> <body style="text-align:center"> <div id=menu_out> <div id=menu_in> <div id=menu> <UL id=nav> <li><A class=nav_on id=mynav0 onmouseover=javascript:qiehuan(0) href="#"><SPAN>网站首页</SPAN></A></li> <li><a href="#" onmouseover="javascript:qiehuan(1)" id="mynav1" class="nav_off"><span>网站模板</span></a></li> <li><a href="#" onmouseover="javascript:qiehuan(2)" id="mynav2" class="nav_off"><span>后台模板</span></a></li> <li><a href="#" onmouseover="javascript:qiehuan(3)" id="mynav3" class="nav_off"><span>CSS菜单</span></a></li> <li><a href="#" onmouseover="javascript:qiehuan(4)" id="mynav4" class="nav_off"><span>脚本下载</span></a></li> <li><a href="#" onmouseover="javascript:qiehuan(5)" id="mynav5" class="nav_off"><span>网页特效</span></a></li> <li><a href="#" onmouseover="javascript:qiehuan(6)" id="mynav6" class="nav_off"><span>新闻中心</span></a></li> <li><a href="#" onmouseover="javascript:qiehuan(7)" id="mynav7" class="nav_off"><span>联系我们</span></a></li> </UL> <div id=menu_con> <div id=qh_con0 style="DISPLAY: block"></div> <div id=qh_con1 style="DISPLAY: none"></div> <div id=qh_con2 style="DISPLAY: none"></div> <div id=qh_con3 style="DISPLAY: none"></div> <div id=qh_con4 style="DISPLAY: none"></div> <div id=qh_con5 style="DISPLAY: none"></div> <div id=qh_con6 style="DISPLAY: none"></div> <div id=qh_con7 style="DISPLAY: none"></div> </div> </div> </div> </div> </body> </html>
The above is JS CSS to realize the atmospheric black homepage navigation Menu effect code_javascript skills content, for more related content, please pay attention to the PHP Chinese website (www.php.cn)!

去掉重复并排序的方法:1、使用“Array.from(new Set(arr))”或者“[…new Set(arr)]”语句,去掉数组中的重复元素,返回去重后的新数组;2、利用sort()对去重数组进行排序,语法“去重数组.sort()”。

本篇文章给大家带来了关于JavaScript的相关知识,其中主要介绍了关于Symbol类型、隐藏属性及全局注册表的相关问题,包括了Symbol类型的描述、Symbol不会隐式转字符串等问题,下面一起来看一下,希望对大家有帮助。

怎么制作文字轮播与图片轮播?大家第一想到的是不是利用js,其实利用纯CSS也能实现文字轮播与图片轮播,下面来看看实现方法,希望对大家有所帮助!

本篇文章给大家带来了关于JavaScript的相关知识,其中主要介绍了关于对象的构造函数和new操作符,构造函数是所有对象的成员方法中,最早被调用的那个,下面一起来看一下吧,希望对大家有帮助。

本篇文章给大家带来了关于JavaScript的相关知识,其中主要介绍了关于面向对象的相关问题,包括了属性描述符、数据描述符、存取描述符等等内容,下面一起来看一下,希望对大家有帮助。

方法:1、利用“点击元素对象.unbind("click");”方法,该方法可以移除被选元素的事件处理程序;2、利用“点击元素对象.off("click");”方法,该方法可以移除通过on()方法添加的事件处理程序。

本篇文章给大家带来了关于JavaScript的相关知识,其中主要介绍了关于BOM操作的相关问题,包括了window对象的常见事件、JavaScript执行机制等等相关内容,下面一起来看一下,希望对大家有帮助。

foreach不是es6的方法。foreach是es3中一个遍历数组的方法,可以调用数组的每个元素,并将元素传给回调函数进行处理,语法“array.forEach(function(当前元素,索引,数组){...})”;该方法不处理空数组。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Atom editor mac version download
The most popular open source editor

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 English version
Recommended: Win version, supports code prompts!
