Advertisement
Demi-monde

Stylized CSS accordian

Apr 7th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.65 KB | None | 0 0
  1. <style>
  2. /*OTHER CSS, BODY, BACKGROUND ETC WOULD GO HERE*/
  3.  
  4. /*Slides*/
  5.  
  6. /*Position, location, colors, font face can all be edited below. Size can also be adjusted. */
  7.  
  8. .accordion {
  9. Position: absolute;
  10. top:58%;
  11. left:35%;
  12. font: 500 100% 'Raleway', 'Questrial';
  13. color: #444;
  14. font-size: .75em;
  15. border-color: #393952;
  16. border-style: solid;
  17. border-width: 4px;
  18. margin: 0 auto;
  19. height: 230px; /*SIZE*/
  20. width: 415px; /*SIZE*/
  21. -webkit-box-shadow:0 0 20px rgba(0,0,0,0.8);
  22. -moz-box-shadow:0 0 20px rgba(0,0,0,0.8);
  23. box-shadow:0 0 20px rgba(0,0,0,0.8);
  24. -webkit-transition: all 2.0s ease-in-out;
  25. -moz-transition: all 2.0s ease-in-out;
  26. -o-transition: all 2.0s ease-in-out;}
  27.  
  28. .accordion > ul > li,
  29. .accordion-title,
  30. .accordion-content,
  31. .accordion-separator {
  32. float: left;
  33. }
  34.  
  35. .accordion > ul > li {
  36. background-color: #393952;
  37. margin-right: -290px; /*SIZE can be adjusted. If you change the overall size of the Accordian*/
  38. margin-bottom: 0;
  39. }
  40.  
  41. .accordion-select:checked ~ .accordion-separator {
  42. margin-right: 290px; /*SIZE can be adjusted. If you change the overall size of the Accordian*/
  43. margin-bottom: 0;
  44. }
  45.  
  46. /*Can be edited below for Font Title, color and background*/
  47. .accordion-title,
  48. .accordion-select {
  49. background-color: #b83c4d;
  50. color: #CCC;
  51. width: 25px;
  52. height: 230px;
  53. font-size: 12px;
  54. font-family: 'Questrial';}
  55.  
  56. .accordion-title span {
  57. margin-bottom: 15px; /*Can be edited below for Font Title, color and background*/
  58. margin-left: 20px; /*Can be edited below for Font Title, color and background*/
  59. }
  60.  
  61. .accordion-select:hover ~ .accordion-title,
  62. .accordion-select:checked ~ .accordion-title {
  63. background-color: #393952; /*COLOR can be adjusted.*/
  64. background-image: url(http://rs385.pbsrc.com/albums/oo296/EmO_TEnTAi/Falling%20objects/1_070216wd103_m_cola71a.gif~c200); /*Background of Open Tab. Transparent Gif works well here*/
  65. }
  66.  
  67.  
  68. .accordion-title span {
  69. transform: rotate(-90deg);
  70. -o-transform: rotate(-90deg);
  71. -moz-transform: rotate(-90deg);
  72. -webkit-transform: rotate(-90deg);
  73. -ms-writing-mode: lr-bt;
  74. filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
  75. margin-left: 0;
  76. line-height: 30px;
  77. }
  78.  
  79. .accordion-content {
  80. background-color: #dcd1d8; /*Color & Size can be adjusted. If you change the overall size of the Accordian*/
  81. height: 195px;
  82. width: 250px;
  83. padding: 20px;
  84. }
  85.  
  86.  
  87. /* Do not change following properties, they aren't
  88. generated automatically and are common for each slider. */
  89. .accordion {
  90. overflow: hidden;
  91. }
  92.  
  93. .accordion > ul {
  94. margin: 0;
  95. padding: 0;
  96. list-style: none;
  97. width: 101%;
  98. }
  99.  
  100. .accordion > ul > li,
  101. .accordion-title {
  102. position: relative;
  103. }
  104.  
  105. .accordion-select {
  106. cursor: pointer;
  107. position: absolute;
  108. opacity: 0;
  109. top: 0;
  110. left: 0;
  111. margin: 0;
  112. z-index: 1;
  113. }
  114.  
  115. .accordion-title span {
  116. display: block;
  117. position: absolute;
  118. bottom: 0;
  119. width: 100%;
  120. white-space: nowrap;
  121. }
  122.  
  123. .accordion-content {
  124. position: relative;
  125. overflow-x: hidden;
  126. overflow-y: auto; }
  127.  
  128. .accordion-separator {
  129. transition: margin 0.3s ease 0.1s;
  130. -o-transition: margin 0.3s ease 0.1s;
  131. -moz-transition: margin 0.3s ease 0.1s;
  132. -webkit-transition: margin 0.3s ease 0.1s;
  133. }
  134.  
  135. </style>
  136.  
  137. <div class="accordion">
  138. <ul>
  139. <li>
  140. <input type="radio" name="select" class="accordion-select" checked />
  141. <div class="accordion">
  142. <ul>
  143. <li>
  144. <input type="radio" name="select" class="accordion-select" checked />
  145. <div class="accordion-title">
  146. <span>CHANGE ME</span>
  147. </div>
  148. <div class="accordion-content">
  149.  
  150. INSERT CONTENT HERE ********
  151.  
  152. </div>
  153. <div class="accordion-separator"></div>
  154. </li>
  155. <li>
  156. <input type="radio" name="select" class="accordion-select" />
  157. <div class="accordion-title">
  158. <span>CHANGE ME</span>
  159. </div>
  160. <div class="accordion-content">
  161.  
  162. INSERT STUFF HERE******
  163.  
  164. </div>
  165.  
  166. <div class="accordion-separator"></div>
  167. </li>
  168.  
  169. <li>
  170. <input type="radio" name="select" class="accordion-select" />
  171.  
  172. <div class="accordion-title">
  173. <span>CHANGE ME</span>
  174. </div>
  175.  
  176. <div class="accordion-content">
  177.  
  178. INSERT STUFF HERE******
  179.  
  180. </div>
  181.  
  182. <div class="accordion-separator"></div>
  183. </li>
  184.  
  185. <li>
  186. <input type="radio" name="select" class="accordion-select" />
  187. <div class="accordion-title">
  188. <span>CHANGE ME</span>
  189. </div>
  190. <div class="accordion-content">
  191.  
  192. INSERT STUFF HERE******
  193.  
  194. </div>
  195. <div class="accordion-separator"></div>
  196. </li>
  197.  
  198. <li>
  199. <input type="radio" name="select" class="accordion-select" />
  200. <div class="accordion-title">
  201. <span>CHANGE ME</span>
  202. </div>
  203. <div class="accordion-content">
  204.  
  205. INSERT STUFF HERE******
  206.  
  207. </div>
  208. <div class="accordion-separator"></div>
  209. </li>
  210. </ul>
  211. </div></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement