国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > CSS > 正文

打造最美CSS多級下拉橫向導航菜單代碼

2024-07-11 08:32:46
字體:
來源:轉載
供稿:網友

本文實例為大家分享了純CSS實現多級下拉橫向導航菜單代碼,供大家參考,具體內容如下

先看看效果圖:

實現代碼:

CSS代碼:

CSS Code復制內容到剪貼板
  1. <style type="text/css">    /* for this demo only */  
  2. #backgroundHolder { width:750px; height:500px; padding-top:10px; margin:0 auto; }    /* ---------------------------------------------------------------------------- */  
  3. /* default styling */   .nav, .nav ul { list-style-type:none; margin:0; padding:0; }   
  4. .nav a { text-decoration:none; }    .nav { font-family: arial, sans-serif; font-size:12px; width:650px; margin:0 auto; }   
  5. /* style the links */   .nav a { background:url(ulmulti3/box.gif) no-repeat rightright center; }   
  6. .nav a.top { background:url(ulmulti3/box.gif) no-repeat rightright top; }    .nav a.top2 { background:url(ulmulti3/box2.gif) no-repeat rightright top; }   
  7. .nav a.bottombottom { background:url(ulmulti3/box.gif) no-repeat rightright bottombottom; }    .rightright ul ul a { background:url(ulmulti3/box3.gif) no-repeat rightright center; }   
  8. .rightright ul ul a.top2 { background:url(ulmulti3/box3.gif) no-repeat rightright top; }    .rightright ul ul a.bottombottom { background:url(ulmulti3/box3.gif) no-repeat rightright bottombottom; }   
  9. /* style the <b> element so that is does not affect the size of the link */   .nav a b { color:#fff; font-weight:normal; display:block; padding:5px 10px 5px 15px; }   
  10. .nav .fly .main b { background: transparent url(ulmulti3/arrow.gif) no-repeat 117px 9px; }    .nav .down b { background: transparent url(ulmulti3/arrow2.gif) no-repeat 115px 11px; }   
  11. .nav .rightright ul b { text-align:rightright; }    .nav .rightright ul ul b { padding: 5px 15px 5px 10px; }   
  12. .nav .rightright ul .main b { background: transparent url(ulmulti3/arrow3.gif) no-repeat 15px 9px; text-align:rightright; }    .nav .rightright ul ul .main b { background: transparent url(ulmulti3/arrow3.gif) no-repeat 5px 9px; text-align:rightright; }   
  13. /* HEIGHT */   .nav ul ul { top:-24px; } /* position the top of the flyout first sub menus */  
  14. .nav ul ul ul { top:-25px; } /* position the top of the flyout second and third sub menus */   .nav ul.two { top:-40px; } /* position the top of the flyout sub menus with previous text on two lines */  
  15. /* WIDTH change this WITH CARE to suit your requirements */       
  16. /*set the link width here*/   .nav .drop, .nav a { width:130px; }   
  17. .nav ul li { max-width:130px; } /* fix for IE8 */   /* set the left flyout position here */  
  18. .nav ul ul { left:130px; }    /* set the right flyout position here */  
  19. .nav li.rightright ul ul { left:auto; rightright:120px; }    .nav li.rightright ul ul ul { left:auto; rightright:130px; }   
  20. /* make this WIDTH - 1px */ /* or WIDTH - 0.063em if using em sizing */   .nav a { margin-right:-129px; }   
  21. /* ---------------------------------------------------------------------------- */       
  22. /* DO NOT CHANGE ANYTHING BELOW */   .nav li { float:left; } /* fixes IE bugs, and allows for clearing */  
  23. .nav ul { float:left; position:relative; z-index:20; } /* necessary for float drop and to stack the <ul>s */   .nav ul li { clear:left; } /* must clear the floated list item inside sublist */  
  24. .nav a { position:relative; display:block; } /* needs to have a position, to be above the rest */   .nav a.main { float:left; /* necessary for float drop */ margin-top:10000px; } /* bring the top level links back into view */  
  25. .nav .drop, .nav .fly { margin-top:-10000px; } /* hide the sub links and their containers, opera has low upper limits */   .nav ul { margin-bottom:-5000px; } /* avoid any interaction between the subs, can be any large size */  
  26. /* The bit that does ALL the work to bring the sub menus into view */       
  27. .nav a:hover, .nav a:focus, .nav a:active { margin-right:0; z-index:10; outline:0; }    .nav a:hover b, .nav a:focus b, .nav a:active b { color:#000; cursor:pointer; } /* this is for keyboard tabbing color change */  
  28. /* OPERA fix */   .nav ul:hover, .nav ul ul:hover { clear:left; } /* to stop intermittent sub link :hover problems */  
  29.      /* ---------------------------------------------------------------------------- */  
  30. </style>    <!--[if lte IE 7]>   
  31. <style type="text/css">    /* bug fixes for IE7 and lower - DO NOT CHANGE */  
  32. .nav .fly {width:99%;} /* make each flyout 99% of the prevous level */   a:active {} /* requires a blank style for :active to stop it being buggy */  
  33. </style>      
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 西宁市| 洪洞县| 新乡市| 阜阳市| 康乐县| 井陉县| 靖安县| 青冈县| 堆龙德庆县| 乐陵市| 敖汉旗| 大连市| 牡丹江市| 靖州| 峨眉山市| 黔南| 百色市| 江都市| 普宁市| 安达市| 衡南县| 建水县| 阜平县| 沂源县| 龙陵县| 南郑县| 尖扎县| 巴林左旗| 宁都县| 太和县| 伊宁县| 青河县| 罗城| 安阳县| 奇台县| 武川县| 东港市| 武邑县| 泰和县| 化隆| 梁河县|