Advertisement
1xptolevitico69

Awesome CSS Collapsible Accordion ( no frameworks ) pure CSS

Jan 6th, 2022
748
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.27 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7.     <title>Awesome CSS Collapsible Accordion ( no frameworks ) pure CSS
  8. </title>
  9.     <style>
  10. #bam {
  11.   display: none;
  12. }
  13. #bam:target {
  14.   height: 100px;
  15.   display: block;
  16. }
  17.  
  18. #foo {
  19.   display: none;
  20. }
  21. #foo:after {
  22.   content: url(https://1xpto.netlify.app/pics/car.jpeg);
  23.   position: absolute;
  24.   transform: scale(0.1);
  25.   transform-origin: left top;
  26. }
  27. #foo:target {
  28.   height: 100px;
  29.   display: block;
  30. }
  31.  
  32. #boom {
  33.   display: none;
  34. }
  35. #boom:target {
  36.   height: 100px;
  37.   display: block;
  38. }
  39. body {
  40.   margin: 0;
  41. }
  42. a {
  43.   text-decoration: none;
  44. }
  45. .link {
  46.   text-align: center;
  47.   width: 100%;
  48.   padding: 20px 0;
  49.   background-color: red;
  50.   display: inline-block;
  51.   color: white;
  52.   border-bottom: 1px solid snow;
  53.   font-size: 30px;
  54.   font-family: arial black;
  55. }
  56. .content {
  57.   font-size: 20px;
  58.   font-family: arial;
  59.   padding: 10px;
  60.   cursor: context-menu;
  61. }
  62.  
  63.     .subscribe img{
  64.       position: absolute;
  65.       top: 10px;
  66.       left: 10px;
  67.       width: 150px;
  68.     }
  69.  
  70.  
  71. </style>
  72. </head>
  73. <body>
  74.  
  75.   <a class='subscribe' href='https://www.youtube.com/channel/UCqLpDK0eOsG1eEeF9jOUZkw' target='_blank'><img src='https://1xpto.netlify.app/pics/clone.png'/></a>
  76.  
  77.  
  78.  
  79. <a class='link' href='#bam'>Open Section 1</a>
  80. <a href='#'>
  81.   <div class='content' id='bam'>One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin. He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections.</div>
  82. </a>
  83.  
  84. <a class='link' href='#boom'>Open Section 2</a>
  85. <a href='#'>
  86.   <div class='content' id='boom'>
  87.     Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean.
  88.   </div>
  89. </a>
  90.  
  91. <a class='link' href='#foo'>Open Section 3</a>
  92. <a href='#'>
  93.   <div class='content' id='foo'></div>
  94. </a>
  95.  
  96.  
  97.  
  98.   <script></script>
  99. </body>
  100. </html>
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement