"Accordion"
Bootstrap 4.1.1 Snippet by kanikamadaan

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="row coE-accordion"> <div class="col"> <h2>Open <b>Multiple</b></h2> <ul class="tabs"> <li class="tab"> <input type="checkbox" id="chck1"> <label class="tab-label" for="chck1">Item 1</label> <div class="tab-content"> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </div> </li> <li class="tab"> <input type="checkbox" id="chck2"> <label class="tab-label" for="chck2">Item 2</label> <div class="tab-content"> consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum </div> </li> <li class="tab"> <input type="checkbox" id="chck3"> <label class="tab-label" for="chck3">Item 3</label> <div class="tab-content"> consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum </div> </li> </ul> </div> <div class="col"> <h2>Open <b>One</b></h2> <ul class="tabs"> <li class="tab"> <input type="radio" id="rd1" name="rd"> <label class="tab-label" for="rd1">Item 1</label> <div class="tab-content"> Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit </div> </li> <li class="tab"> <input type="radio" id="rd2" name="rd"> <label class="tab-label" for="rd2">Item 2</label> <div class="tab-content"> Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? </div> </li> <li class="tab"> <input type="radio" id="rd3" name="rd"> <label class="tab-label" for="rd3">Item 3</label> <div class="tab-content"> Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? </div> </li> </ul> </div> </div>
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;600;700;900&family=Titillium+Web:wght@200;400;600;700;900&display=swap'); body { height: 100%; font-family: 'Source Sans Pro', sans-serif, 'FontAwesome' !important; font-size: 14px; color: #4e4e4e; } .coE-accordion h1 { margin: 0; line-height: 2; text-align: center; } .coE-accordion h2 { margin: 0 0 0.5em; font-weight: normal; color: #4bcd3e; margin-bottom: 25px; } .coE-accordion input { position: absolute; opacity: 0; z-index: -1; } .coE-accordion.row { display: flex; } .coE-accordion.row .col { flex: 1; } .coE-accordion.row .col:last-child { margin-left: 1em; } /* Accordion styles */ .coE-accordion .tabs { border-radius: 8px; overflow: hidden; padding-left: 30px; } .coE-accordion .tab { width: 100%; color: white; border-top: 1px solid #dedcdc; } .coE-accordion .tab-label { display: flex; justify-content: space-between; padding: 0.5em .5em 0.5em; color: #009775; font-weight: bold; cursor: pointer; font-size: 18px; /* Icon */ } .coE-accordion ul { list-style-type: decimal; } .coE-accordion li::marker { color: #009775; font-weight: bold; font-size: 16px; } .coE-accordion .tab-label::after { content: "\002B"; width: 1em; height: 1em; font-size: 20px; text-align: center; transition: all 0.35s; } .coE-accordion .tab-content { max-height: 0; padding: 0 1em; color: #2c3e50; background: white; transition: all 0.35s; overflow: hidden; } .coE-accordion .tab-close { display: flex; justify-content: flex-end; padding: 1em; font-size: 0.75em; background: #2c3e50; cursor: pointer; } .coE-accordion input:checked+.tab-label::after { transform: rotate(180deg); content: "\2212"; } .coE-accordion input:checked~.tab-content { max-height: 100vh; padding: 0em 1em 1em; } /* margin */ .coE-accordion .mt-5 { margin-top: 25px; } </style>

Related: See More


Questions / Comments: