Advertisement
firoze

Tab style menu tab

Nov 28th, 2015
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.49 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.  
  4. <head>
  5. <meta charset='UTF-8'>
  6.  
  7. <title>(Better) Round Out Tabs</title>
  8.  
  9. <style>
  10. /*
  11. CSS-Tricks Example
  12. by Chris Coyier
  13. http://css-tricks.com
  14. */
  15.  
  16. * { margin: 0; padding: 0; }
  17. body { font: 14px Georgia, serif; }
  18.  
  19. h1 {
  20. width: 660px;
  21. margin: 0 auto;
  22. padding: 20px 0;
  23. color: #222;
  24. }
  25.  
  26. .group:before,
  27. .group:after {
  28. content: "";
  29. display: table;
  30. }
  31. .group:after {
  32. clear: both;
  33. }
  34. .group {
  35. zoom: 1;
  36. }
  37. .tabrow {
  38. text-align: center;
  39. list-style: none;
  40. margin: 200px 0 20px;
  41. padding: 0;
  42. line-height: 24px;
  43. height: 26px;
  44. overflow: hidden;
  45. font-size: 12px;
  46. font-family: verdana;
  47. position: relative;
  48. }
  49. .tabrow li {
  50. border: 1px solid #AAA;
  51. background: #D1D1D1;
  52. background: -o-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
  53. background: -ms-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
  54. background: -moz-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
  55. background: -webkit-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
  56. background: linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
  57. display: inline-block;
  58. position: relative;
  59. z-index: 0;
  60. border-top-left-radius: 6px;
  61. border-top-right-radius: 6px;
  62. box-shadow: 0 3px 3px rgba(0, 0, 0, 0.4), inset 0 1px 0 #FFF;
  63. text-shadow: 0 1px #FFF;
  64. margin: 0 -5px;
  65. padding: 0 20px;
  66. }
  67. .tabrow a {
  68. color: #555;
  69. text-decoration: none;
  70. }
  71. .tabrow li.selected {
  72. background: #FFF;
  73. color: #333;
  74. z-index: 2;
  75. border-bottom-color: #FFF;
  76. }
  77. .tabrow:before {
  78. position: absolute;
  79. content: " ";
  80. width: 100%;
  81. bottom: 0;
  82. left: 0;
  83. border-bottom: 1px solid #AAA;
  84. z-index: 1;
  85. }
  86. .tabrow li:before,
  87. .tabrow li:after {
  88. border: 1px solid #AAA;
  89. position: absolute;
  90. bottom: -1px;
  91. width: 5px;
  92. height: 5px;
  93. content: " ";
  94. }
  95. .tabrow li:before {
  96. left: -6px;
  97. border-bottom-right-radius: 6px;
  98. border-width: 0 1px 1px 0;
  99. box-shadow: 2px 2px 0 #D1D1D1;
  100. }
  101. .tabrow li:after {
  102. right: -6px;
  103. border-bottom-left-radius: 6px;
  104. border-width: 0 0 1px 1px;
  105. box-shadow: -2px 2px 0 #D1D1D1;
  106. }
  107. .tabrow li.selected:before {
  108. box-shadow: 2px 2px 0 #FFF;
  109. }
  110. .tabrow li.selected:after {
  111. box-shadow: -2px 2px 0 #FFF;
  112. }
  113. </style>
  114.  
  115. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
  116. <script>
  117. $(function() {
  118. $("li").click(function(e) {
  119. e.preventDefault();
  120. $("li").removeClass("selected");
  121. $(this).addClass("selected");
  122. });
  123. });
  124. </script>
  125. </head>
  126.  
  127. <body>
  128.  
  129. <div id="demo-top-bar">
  130.  
  131. <div id="demo-bar-inside">
  132.  
  133. <h2 id="demo-bar-badge">
  134. <a href="/">CSS-Tricks Example</a>
  135. </h2>
  136.  
  137. <div id="demo-bar-buttons">
  138. </div>
  139.  
  140. </div>
  141.  
  142. </div>
  143. <ul class="tabrow">
  144. <li class="selected"><a href="#">Lorem</a></li>
  145. <li><a href="#">Ipsum</a></li>
  146. <li><a href="#">Sit amet</a></li>
  147. <li><a href="#">Consectetur adipisicing</a></li>
  148. <li><a href="#">adipisicing</a></li>
  149. </ul>
  150.  
  151. <style type="text/css" style="display: none !important;">
  152. * {
  153. margin: 0;
  154. padding: 0;
  155. }
  156. body {
  157. overflow-x: hidden;
  158. }
  159. #demo-top-bar {
  160. text-align: left;
  161. background: #222;
  162. position: relative;
  163. zoom: 1;
  164. width: 100% !important;
  165. z-index: 6000;
  166. padding: 20px 0 20px;
  167. }
  168. #demo-bar-inside {
  169. width: 960px;
  170. margin: 0 auto;
  171. position: relative;
  172. overflow: hidden;
  173. }
  174. #demo-bar-buttons {
  175. padding-top: 10px;
  176. float: right;
  177. }
  178. #demo-bar-buttons a {
  179. font-size: 12px;
  180. margin-left: 20px;
  181. color: white;
  182. margin: 2px 0;
  183. text-decoration: none;
  184. font: 14px "Lucida Grande", Sans-Serif !important;
  185. }
  186. #demo-bar-buttons a:hover,
  187. #demo-bar-buttons a:focus {
  188. text-decoration: underline;
  189. }
  190. #demo-bar-badge {
  191. display: inline-block;
  192. width: 302px;
  193. padding: 0 !important;
  194. margin: 0 !important;
  195. background-color: transparent !important;
  196. }
  197. #demo-bar-badge a {
  198. display: block;
  199. width: 100%;
  200. height: 38px;
  201. border-radius: 0;
  202. bottom: auto;
  203. margin: 0;
  204. background: url(/images/examples-logo.png) no-repeat;
  205. background-size: 100%;
  206. overflow: hidden;
  207. text-indent: -9999px;
  208. }
  209. #demo-bar-badge:before, #demo-bar-badge:after {
  210. display: none !important;
  211. }
  212. </style>
  213. </body>
  214.  
  215. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement