三级menu导航样式

Original 2019-05-18 16:27:14 225
abstract:<!DOCTYPE html><html>                 <head>         &nbs

<!DOCTYPE html>

<html>

                 <head>

                 <meta charset="utf-8">

                 <link rel="icon" type="image/x-icon" href="">

                 <link rel="stylesheet" type="text/css" href=""> 

                 <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>

                 <style type="text/css">

                 *{margin:0;padding:0;}

                 .main{width:1000px;height:35px;margin:0px auto;margin-top:30px;background:rgb(29,98,169);color:#fff;border-radius:10px;}

                 .main ul{line-height: 35px;text-align:center;font-size:0;}

                .main ul li{line-height:35px;list-style:none;width:100px;position:relative;display:inline-block;border-right:0px solid #fff;font-size: 16px;align: center;}

                 .split{width:0px!important;}

                 .product{position:absolute;left:3px;top:35px;width:98px;background:rgb(29,98,169);color:#fff;display:none;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;}

                 .product li{width:98px;line-height:35px;text-align:center;position:relative;}

                 .proSub{position:absolute;width:100px;left:110px;top:8px;background:rgb(29,98,169);color:#fff;display:none;border-radius: 5px;}

                 .proSub li{position:relative;}

                 .triangle-left {

                 position:absolute;left:-10px;top:5px;

                     width: 0;

                     height: 0;

                     border-top: 6px solid transparent;

                     border-right: 10px solid rgb(29,98,169);

                     border-bottom: 6px solid transparent;

                     

                 }

                 </style>

                 <title>menu导航样式</title>

                 </head>

                 <body>

                                 <div class="main">

                                             <ul>

                                                     <li>首页</li>

                                                     <li class="split">|</li>

                                                                 <li>产品

                                                                        <ul class="product">

                                                                              <li>产品1

                                                                                 <ul class="proSub">

                                                                                              <li><div class="triangle-left"></div>产品1-1</li>

                                                                                             <li>产品1-2</li>

                                                                                             <li>产品1-3</li>

                                                                                 </ul>

                                                                              </li>

                                                                               <li>产品2

                                                                                         <ul class="proSub">

                                                                                                     <li><div class="triangle-left"></div>产品2-1</li>

                                                                                                     <li>产品2-2</li>

                                                                                                     <li>产品2-3</li>

                                                                                         </ul>

                                                                                 </li>

                                                                         <li>产品3</li>

                                                                         </ul>

                                                             </li>

                                                          <li class="split">|</li>

                                                          <li>公司新闻</li>

                                                          <li class="split">|</li>

                                                          <li>行业新闻</li>

                                                           <li class="split">|</li>

                                                           <li>联系我们</li>

                                             </ul>

                                 </div>

                 <script>

                 $(function(){

                                     $('.main>ul>li').mouseover(function(){

                                                     $(this).find('.product').slideDown(500);

                                                     console.log($(this).find('.product'));

                                                     console.log('OK')

                                     })

                                     $('.main>ul>li').mouseleave(function(){

                                                     $(this).find('.product').slideUp(500);

                                     })

                                     $('.product>li').mouseover(function(){

                                                     $(this).find('.proSub').slideDown(500);

                                     })

                                     $('.product>li').mouseleave(function(){

                                                      $(this).find('.proSub').slideUp(500);

                                     })

                  })

                  </script>

                 </body>

</html>


Correcting teacher:查无此人Correction time:2019-05-20 09:13:08
Teacher's summary:完成的不错。css样式学好,做出来的页面很绚丽。继续加油。

Release Notes

Popular Entries