溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

怎么用DIV+CSS實(shí)現(xiàn)仿電商網(wǎng)站導(dǎo)航條效果

發(fā)布時(shí)間:2021-08-05 09:12:01 來(lái)源:億速云 閱讀:148 作者:chen 欄目:web開(kāi)發(fā)

本篇內(nèi)容主要講解“怎么用DIV+CSS實(shí)現(xiàn)仿電商網(wǎng)站導(dǎo)航條效果”,感興趣的朋友不妨來(lái)看看。本文介紹的方法操作簡(jiǎn)單快捷,實(shí)用性強(qiáng)。下面就讓小編來(lái)帶大家學(xué)習(xí)“怎么用DIV+CSS實(shí)現(xiàn)仿電商網(wǎng)站導(dǎo)航條效果”吧!

這里演示了DIV+CSS實(shí)現(xiàn)仿電商網(wǎng)站導(dǎo)航條功能代碼,鼠標(biāo)滑過(guò)導(dǎo)航條選項(xiàng)即可彈出對(duì)應(yīng)的子菜單列表,界面簡(jiǎn)潔大方。

運(yùn)行效果截圖如下:

怎么用DIV+CSS實(shí)現(xiàn)仿電商網(wǎng)站導(dǎo)航條效果

在線演示地址如下:

http://demo.jb51.net/js/2015/div-css-f-jd-shop-nav-style-codes/

具體代碼如下:

代碼如下:

<!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=utf8" />
<title>京東商城導(dǎo)航條</title>
<style type="text/css">
.my_left_category{
   width:150px;
   font-size:12px;
   font-family:arial,sans-serif;
   letter-spacing:2px;
}
.my_left_category h2{
   background-image:url(images/spring_06.gif);
   height:20px;
   background-repeat:no-repeat;
   font-size:14px;
   font-weight:bold;
   padding-left:15px;
   padding-top:8px;
   margin:0px;
   color:#FFF;
}
.my_left_category .my_left_cat_list{
width:148px;
border-color:#b60134;
border-style:solid;
border-width:0px 1px 1px 1px;
line-height:13.5pt;
}
.my_left_category .my_left_cat_list h3 {
margin:0px;
padding:3px 5px 0px 9px;
}
.my_left_category .my_left_cat_list h3 a {
color:#d6290b;
font-weight:bold;
font-size:14px;
line-height:22px;
}
.my_left_category .my_left_cat_list h3 a:hover {
color:#d6290b;
font-weight:bold;
font-size:14px;
line-height:22px;
}
.my_left_category .h3_cat{
 width:148px;
 height:26px;
 background-image:url(images/my_menubg.gif);
 background-repeat:no-repeat;
 line-height:26px;
 font-weight:normal;
 color:#333333;
 position:relative;
}
.my_left_category .h3_cat_1{
 width:148px;
 height:26px;
 background-image:url(images/my_menubg_1.gif);
 background-repeat:no-repeat;
 line-height:26px;
 font-weight:normal;
 color:#333333;
 position:relative;
}
.my_left_category a{
 font:12px;
 text-decoration:none;
 color:#333333;
}
.my_left_category a:hover{
 text-decoration:underline;
 color:#ff3333;
}
.my_left_category h4{
margin:0px;
padding:0px;
height:26px;
font-size:12px;
font-weight:normal;
display:block;
padding-left:8px;
}
.my_left_category h4 span{color:#999999; width:145px; float:right;}
.my_left_category h4 a{  line-height:26px;}
.my_left_category .h4_cat{
display:none;
width:204px;
position:absolute;
left:123px;
margin-top:-26px;
cursor:auto;
}
.my_left_category .shadow{
position:inherit;
background:url(images/shadow_04.gif) left top;
width:204px;
}
.my_left_category .shadow_border{
position:inherit;
width:200px;
border:1px solid #959595; margin-top:1px;
border-left-width:0px;
background:url(images/shadow_border.gif) no-repeat 0px 21px;
background-color:#ffffff;
margin-bottom:3px
}
.my_left_category .shadow_border ul{margin:0; padding:0; margin-left:15px}
.my_left_category .shadow_border ul li {
list-style:none;
padding-left:10px;
background-image:url(images/my_cat_sub_menu_dot.gif);
background-repeat:no-repeat;
background-position:0px 8px;
float:left;
width:75px;
height:26px;
overflow:hidden;
letter-spacing:0px;
}
.my_left_category .active_cat{ z-index:99;background-position:0 -25px;cursor:pointer;}
.my_left_category .active_cat h4 { font-weight:bold}
.my_left_category .active_cat h4 span{ display:none;}
.my_left_category .active_cat div{display:block;}
</style>
</head>
<body>
<div class="my_left_category">
 <h2>分類導(dǎo)航</h2>
 <div class="my_left_cat_list">
   <h3><a href="#">按網(wǎng)站類別</a></h3>
   <div class="h3_cat" onmouseover="this.className='h3_cat active_cat'" onmouseout="this.className='h3_cat'">
     <h4><a href="#">企業(yè)建站</a></h4>
     <div class="h4_cat">
        <div class="shadow">
         <div class="shadow_border">
           <ul>
            <li><a href="#">LOGO設(shè)計(jì)</a></li>
            <li><a href="#">網(wǎng)站設(shè)計(jì)</a></li>
            <li><a href="#">網(wǎng)站廣告</a></li>
            <li><a href="#">推廣</a></li>
            <li><a href="#">建網(wǎng)站</a></li>
            <li><a href="#">網(wǎng)站推廣</a></li>
            <li><a href="#">網(wǎng)站建設(shè)</a></li>
            <li><a href="#">SEO</a></li>
           </ul>
         </div>
        </div>
     </div>    
   </div>
   <div class="h3_cat" onmouseover="this.className='h3_cat active_cat'" onmouseout="this.className='h3_cat'">
     <h4><a href="#">韓國(guó)男裝</a></h4>
     <div class="h4_cat">
       <div class="shadow">
         <div class="shadow_border">
           <ul>
            <li><a href="#">LOGO設(shè)計(jì)</a></li>
            <li><a href="#">網(wǎng)站設(shè)計(jì)</a></li>
            <li><a href="#">網(wǎng)站廣告</a></li>
            <li><a href="#">推廣</a></li>
            <li><a href="#">建網(wǎng)站</a></li>
            <li><a href="#">網(wǎng)站推廣</a></li>
            <li><a href="#">網(wǎng)站建設(shè)</a></li>
            <li><a href="#">SEO</a></li>
           </ul>
         </div>
       </div>  
     </div>    
   </div>
   <div class="h3_cat" onmouseover="this.className='h3_cat active_cat'" onmouseout="this.className='h3_cat'">
     <h4><a href="#">億速云</a></h4>
     <div class="h4_cat">
       <div class="shadow">
         <div class="shadow_border">
           <ul>
            <li><a href="#">LOGO設(shè)計(jì)</a></li>
            <li><a href="#">源碼下載</a></li>
            <li><a href="#">最新更新</a></li>
            <li><a href="#">下載排行</a></li>
            <li><a href="#">ASP</a></li>
            <li><a href="#">PHP</a></li>
            <li><a href="#">AJAX</a></li>
            <li><a href="#">DELPHI</a></li>
           </ul>
         </div>
       </div>  
     </div>    
   </div>
<!-- again -->
   <h3><a href="#">按品牌選貨</a></h3>
   <div class="h3_cat" onmouseover="this.className='h3_cat active_cat'" onmouseout="this.className='h3_cat'">
     <h4><a href="#" >熱銷推薦</a></h4>
     <div class="h4_cat">
        <div class="shadow">
         <div class="shadow_border">
           <ul>
            <li><a href="#">LOGO設(shè)計(jì)</a></li>
            <li><a href="#">網(wǎng)站設(shè)計(jì)</a></li>
            <li><a href="#">網(wǎng)站廣告</a></li>
            <li><a href="#">推廣</a></li>
            <li><a href="#">建網(wǎng)站</a></li>
            <li><a href="#">網(wǎng)站推廣</a></li>
            <li><a href="#">網(wǎng)站建設(shè)</a></li>
            <li><a href="#">SEO</a></li>
           </ul>
         </div>
        </div>
     </div>    
   </div>
   <div class="h3_cat" onmouseover="this.className='h3_cat active_cat'" onmouseout="this.className='h3_cat'">
     <h4><a href="#">網(wǎng)站建設(shè)</a></h4>
     <div class="h4_cat">
       <div class="shadow">
         <div class="shadow_border">
           <ul>
            <li><a href="#">LOGO設(shè)計(jì)</a></li>
            <li><a href="#">網(wǎng)站設(shè)計(jì)</a></li>
            <li><a href="#">推廣</a></li>
            <li><a href="#">建網(wǎng)站</a></li>
            <li><a href="#">網(wǎng)站推廣</a></li>
            <li><a href="#">推廣</a></li>
            <li><a href="#">LOGO設(shè)計(jì)</a></li>
            <li><a href="#">網(wǎng)站設(shè)計(jì)</a></li>
            <li><a href="#">網(wǎng)站廣告</a></li>
            <li><a href="#">推廣</a></li>
            <li><a href="#">建網(wǎng)站</a></li>
            <li><a href="#">網(wǎng)站推廣</a></li>
            <li><a href="#">網(wǎng)站建設(shè)</a></li>
            <li><a href="#">LOGO設(shè)計(jì)</a></li>
            <li><a href="#">網(wǎng)站設(shè)計(jì)</a></li>
            <li><a href="#">網(wǎng)站建設(shè)</a></li>
            <li><a href="#">SEO</a></li>
           </ul>
         </div>
       </div>  
     </div>    
   </div>
   <div class="h3_cat" onmouseover="this.className='h3_cat active_cat'" onmouseout="this.className='h3_cat'">
     <h4><a href="#">網(wǎng)站程序</a></h4>
     <div class="h4_cat">
       <div class="shadow">
         <div class="shadow_border">
           <ul>
            <li><a href="#">PHP</a></li>
            <li><a href="#">ASP</a></li>
            <li><a href="#">JSP</a></li>
            <li><a href="#">ASP.Net</a></li>
           </ul>
         </div>
       </div>  
     </div>    
   </div>
   <div class="h3_cat_1" onmouseover="this.className='h3_cat_1 active_cat'" onmouseout="this.className='h3_cat_1'">
     <h4><a href="#">其他網(wǎng)站</a></h4>
   </div>
 <!-- again -->
   <h3><a href="#">按價(jià)格選貨</a></h3>
   <div class="h3_cat" onmouseover="this.className='h3_cat active_cat'" onmouseout="this.className='h3_cat'">
     <h4><a href="#">低端價(jià)位</a></h4>
     <div class="h4_cat">
        <div class="shadow">
         <div class="shadow_border">
           <ul>
            <li><a href="#">50元以下</a></li>
            <li><a href="#">50-100元</a></li>
           </ul>
         </div>
        </div>
     </div>    
   </div>
   <div class="h3_cat" onmouseover="this.className='h3_cat active_cat'" onmouseout="this.className='h3_cat'">
     <h4><a href="#">中高端價(jià)位</a></h4>
     <div class="h4_cat">
       <div class="shadow">
         <div class="shadow_border">
           <ul>
            <li><a href="#">100-150元</a></li>
            <li><a href="#">150-200元</a></li>
            <li><a href="#">200-300元</a></li>
            <li><a href="#">300元以上</a></li>
            </ul>
         </div>
       </div>  
     </div>    
   </div>
     <!-- again -->
   <h3><a href="#">超值特價(jià)區(qū)</a></h3>
   <h3><a href="#">現(xiàn)貨區(qū)</a></h3>
<!--測(cè)試復(fù)制end-->    
</div>
</div>
</body>
</html>

到此,相信大家對(duì)“怎么用DIV+CSS實(shí)現(xiàn)仿電商網(wǎng)站導(dǎo)航條效果”有了更深的了解,不妨來(lái)實(shí)際操作一番吧!這里是億速云網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI