Customized Drop Down jQuery Menu CSS


/ Published in: CSS
Save to your folder(s)



Copy this code and paste it in your HTML
  1. /*** ESSENTIAL STYLES ***/
  2. .sf-menu, .sf-menu * {
  3. margin: 0;
  4. padding: 0;
  5. list-style: none;
  6. }
  7. .sf-menu {
  8. line-height: 1.40;
  9. }
  10. .sf-menu ul {
  11. position: absolute;
  12. top: -999em;
  13. _width: 40em; /* left offset of submenus need to match (see below) */
  14. }
  15. .sf-menu ul li {
  16. width: 100%;
  17. }
  18. .sf-menu li:hover {
  19. visibility: inherit; /* fixes IE7 'sticky bug' */
  20. }
  21. .sf-menu li {
  22. float: left;
  23. position: relative;
  24. }
  25. .sf-menu a {
  26. display: block;
  27. position: relative;
  28. }
  29. /* Category hover effect*/
  30. .sf-menu li:hover ul,
  31. .sf-menu li.sfHover ul {
  32. left: 0.8em;
  33. top: 2.2em; // match top ul list item height
  34. z-index: 99;
  35. }
  36.  
  37. ul.sf-menu li:hover li ul,
  38. ul.sf-menu li.sfHover li ul {
  39. top: -999em;
  40. }
  41. ul.sf-menu li li:hover ul,
  42. ul.sf-menu li li.sfHover ul {
  43. left: 15em; /* match ul width */
  44. top: 0;
  45. }
  46. ul.sf-menu li li:hover li ul,
  47. ul.sf-menu li li.sfHover li ul {
  48. top: -999em;
  49. }
  50. ul.sf-menu li li li:hover ul,
  51. ul.sf-menu li li li.sfHover ul {
  52. left: 40em; /* match ul width */
  53. top: 0;
  54. }
  55.  
  56. /*** DEMO SKIN ***/
  57. .sf-menu {
  58. float: left;
  59. margin-bottom: .75em;
  60. }
  61. .sf-menu a {
  62. border-left: 1px solid #fff;
  63. border-top: 1px solid #CFDEFF;
  64. padding: 1.5em 1.5em 0.6em 1em;
  65. text-decoration:none;
  66. }
  67. .sf-menu a, .sf-menu a:visited { /* visited pseudo selector so IE6 applies text colour*/
  68. color: #fff;
  69. }
  70.  
  71. .sf-menu li {
  72. background: #BDD2FF;
  73. }
  74. .sf-menu li li {
  75. background: #AABDE6;
  76. }
  77. .sf-menu li li a{
  78. padding: 0.5em;
  79. margin: 1.2em;
  80. }
  81.  
  82. .sf-menu li li li a{
  83. padding: 0.25em;
  84. margin: .25em;
  85. }
  86. .sf-menu li li li {
  87. background: #9AAEDB;
  88. }
  89. .sf-menu li:hover, .sf-menu li.sfHover,
  90. .sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {
  91. background: #CFDEFF;
  92. outline: 0;
  93. color: #ffbe40;
  94. }
  95. /*** arrows **/
  96. .sf-menu a.sf-with-ul {
  97. padding-right: .75em;
  98. min-width: 1px; /* trigger IE7 hasLayout so spans position accurately */
  99. }
  100. .sf-sub-indicator {
  101. position: absolute;
  102. display: block;
  103. right: .75em;
  104. top: 1.05em; /* IE6 only */
  105. width: 10px;
  106. height: 10px;
  107. text-indent: -999em;
  108. overflow: hidden;
  109. background: url('/components/img/nav/arrows-ffffff.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */
  110. }
  111. a > .sf-sub-indicator { /* give all except IE6 the correct values */
  112. top: .8em;
  113. background-position: 0 -100px; /* use translucent arrow for modern browsers*/
  114. }
  115. /* apply hovers to modern browsers */
  116. a:focus > .sf-sub-indicator,
  117. a:hover > .sf-sub-indicator,
  118. a:active > .sf-sub-indicator,
  119. li:hover > a > .sf-sub-indicator,
  120. li.sfHover > a > .sf-sub-indicator {
  121. background-position: -10px -100px; /* arrow hovers for modern browsers*/
  122. }
  123.  
  124. /* point right for anchors in subs */
  125. .sf-menu ul .sf-sub-indicator { background-position: -10px 0; }
  126. .sf-menu ul a > .sf-sub-indicator { background-position: 0 0; }
  127. /* apply hovers to modern browsers */
  128. .sf-menu ul a:focus > .sf-sub-indicator,
  129. .sf-menu ul a:hover > .sf-sub-indicator,
  130. .sf-menu ul a:active > .sf-sub-indicator,
  131. .sf-menu ul li:hover > a > .sf-sub-indicator,
  132. .sf-menu ul li.sfHover > a > .sf-sub-indicator {
  133. background-position: -10px 0; /* arrow hovers for modern browsers*/
  134. }
  135.  
  136. /*** shadows for all but IE6 ***/
  137. .sf-shadow ul {
  138. /* background: url('/components/img/nav/shadow.png') no-repeat bottom right;*/
  139. padding: 0 8px 9px 0;
  140. -moz-border-radius-bottomleft: 17px;
  141. -moz-border-radius-topright: 17px;
  142. -webkit-border-top-right-radius: 17px;
  143. -webkit-border-bottom-left-radius: 17px;
  144. }
  145. .sf-shadow ul.sf-shadow-off {
  146. background: transparent;
  147. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.