Javascript实现简易导航栏

2022-04-15 0 1,144

本文实例为大家分享了Javascript实现简易导航栏的具体代码,供大家参考,具体内容如下

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>导航</title>
</head>
<style>
        button{
              width:80px;
              height:25px;
              border:none;
        }
          #b1{
             background-image: url('1.png');
             margin-right:0px;
           
          }
          #b2{
             background-image: url('1.png');
             width:380px;
             height:25px;
             text-align: left;

          }
         #b1:hover{
            background-image: url('2.png');   
         }
         #b2:hover{
            background-image: url('2.png');   
         }
        
</style>

<body>
    <div style="width: 800px;margin:0px auto">
        
    
    <div>
            <img src="1.jpg" width="100%" height="150px%">
    </div>
    <div>
            <div style="font-size: 1px">
                    <button type="button" id="b1">网站首页</button>
                    <button type="button" id="b1">网站新闻</button>
                    <button type="button" id="b1">网站趣闻</button>
                    <button type="button" id="b1">网站论坛</button>
                    <button type="button" id="b1">网站介绍</button> 
                    <button type="button" id="b2">招纳贤士</button>
                    
            </div>
              
             
    </div>
     </div>
</body>
</html>

效果图:

Javascript实现简易导航栏

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持NICE源码。

免责声明:
1、本网站所有发布的源码、软件和资料均为收集各大资源网站整理而来;仅限用于学习和研究目的,您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。 不得使用于非法商业用途,不得违反国家法律。否则后果自负!

2、本站信息来自网络,版权争议与本站无关。一切关于该资源商业行为与www.niceym.com无关。
如果您喜欢该程序,请支持正版源码、软件,购买注册,得到更好的正版服务。
如有侵犯你版权的,请邮件与我们联系处理(邮箱:skknet@qq.com),本站将立即改正。

NICE源码网 JavaScript Javascript实现简易导航栏 https://www.niceym.com/28782.html