JSFiddle - React, Tailwind, and code Playground

by Neeraj Yadav

HTML

<!DOCTYPE html>
<html>

  <head>
    <title>CSS Accordion Slider</title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  </head>

  <body>
    <div class="slider">
      <ul>
        <li>
          <input type="radio" name="select" class="slider-select" checked />
          <div class="slider-title">
            <span>Title</span>
          </div>
          <div class="slider-content">
            Content
          </div>
          <div class="slider-separator"></div>
        </li>
        <li>
          <input type="radio" name="select" class="slider-select" />
          <div class="slider-title">
            <span>Title</span>
          </div>
          <div class="slider-content">
            Content
          </div>
          <div class="slider-separator"></div>
        </li>
      </ul>
    </div>
  </body>

</html>

CSS

.slider {
  -webkit-box-shadow: 0px 75px 35px -55px rgba(10, 30, 65, 0.6);
  -moz-box-shadow: 0px 75px 35px -55px rgba(10, 30, 65, 0.6);
  box-shadow: 0px 75px 35px -55px rgba(10, 30, 65, 0.6);
  font-family: Arial, Helvetica, sans-serif;
  border-color: #505050;
  border-style: solid;
  border-width: 0px;
  border-radius: 8px;
  margin: 0 auto;
  height: 290px;
  width: 784px;
}

.slider>ul>li,
.slider-title,
.slider-content,
.slider-separator {
  float: left;
}

.slider>ul>li {
  background-color: #1f1f1f;
  margin-right: -700px;
  margin-bottom: -0px;
}

.slider-select:checked~.slider-separator {
  margin-right: 700px;
  margin-bottom: 0px;
}

.slider-title,
.slider-select {
  background-color: #2d2d2d;
  color: #ffffff;
  width: 40px;
  height: 290px;
  font-size: 15px;
}

.slider-title span {
  margin-bottom: 20px;
  margin-left: 20px;
}

.slider-select:hover~.slider-title,
.slider-select:checked~.slider-title {
  background-color: #3068cc;
}

.slider-title span {
  transform: rotate(-90deg);
  -o-transform: rotate(-90deg);
  -moz-transform: rotate(-90deg);
  -webkit-transform: rotate(-90deg);
  -ms-writing-mode: lr-bt;
  filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
  margin-left: 0px;
  line-height: 40px;
}

.slider-content {
  background-color: #3e3e3e;
  color: #f5f2f0;
  height: 234px;
  width: 644px;
  padding: 28px;
}

.slider-title,
.slider-select:checked~.slider-content {
  margin-right: 1px;
  margin-bottom: 1px;
}

/* Do not change following properties, they aren't 
generated automatically and are common for each slider. */

.slider {
  overflow: hidden;
}

.slider>ul {
  margin: 0;
  padding: 0;
  list-style: none;
  width: 101%;
}

.slider>ul>li,
.slider-title {
  position: relative;
}

.slider-select {
  cursor: pointer;
  position: absolute;
  opacity: 0;
  top: 0;
  left: 0;
  margin: 0;
  z-index: 1;
}

.slider-title span {
  display: block;
  position: absolute;
  bottom: 0px;
  width: 100%;
  white-space:...