云南农职《JavaScript交互式网页设计》 综合机试试卷④——蔚蓝网导航栏

  • |
  • 礼品卡
  • |
  • 新手入门
    • 购物保障
    • 购物流程
    • 会员介绍
    • 常见问题
    • |
    • 客户服务
    • css:

      *{

      margin: 0;

      padding: 0;

      }

      a{

      color: black;

      text-decoration: none;

      }

      /* 整个导航栏样式 */

      #top{

      width: 100%;

      height: 50px;

      margin: 0 auto;

      line-height: 50px;

      background-color: aqua;

      }

      /* 导航栏左边 */

      .top_left{

      margin-left: 10%;

      float: left;

      }

      .top_left a:hover{

      color: blue;

      }

      /* 导航栏右边 */

      .top_right{

      margin-right: 10%;

      float: right;

      }

      .top_right>ul>li{

      list-style: none;

      float: left;

      margin-left: 15px;

      }

      .top_right img{

      width: 30px ;

      height: 30px ;

      line-height: 50px;

      }

      /* 新手入门,选项 */

      .xsrm{

      display: none;

      text-align: center;

      list-style: none;

      }

      .xsrm li{

      border: solid 1px;

      JS:

      var xsrm_ul = document.getElementById(“xsrm_ul”);

      var xsrm = document.getElementsByClassName(“xsrm”);

      // 鼠标移入事件

      xsrm_ul.onmouseover = function(){

      xsrm[0].style.display=“block”;

      };

      // 鼠标移出时间

      xsrm_ul.onmouseout = function(){

      xsrm[0].style.display=“none”;

      };

      使用jQuery的hover事件实现:

      使用jQuery鼠标移入移出事件:

      完整代码:

      您好,欢迎光临蔚蓝网!

      [登录]

      [免费注册]

      分享

    评论
    添加红包

    请填写红包祝福语或标题

    红包个数最小为10个

    红包金额最低5元

    当前余额3.43前往充值 >
    需支付:10.00
    成就一亿技术人!
    领取后你会自动成为博主和红包主的粉丝 规则
    hope_wisdom
    发出的红包
    实付
    使用余额支付
    点击重新获取
    扫码支付
    钱包余额 0

    抵扣说明:

    1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
    2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

    余额充值