Posts

Showing posts with the label accordion

How to create a responsive accordion with html and css

Image
 How to create a responsive accordion with html and css Accordions are useful when you want to toggle between hiding and showing large amount of content. We will create accordion with very simple and easy way. Here is the code <! DOCTYPE   html > < html > < head > < style > button.accordion  {      background-color : #cb4d4d;      color : #fff;      cursor : pointer;      padding :  18px ;      width :  100% ;      border : none;      text-align : left;      outline : none;      font-size :  15px ;      transition :  0.4s ; } button.accordion.active , button.accordion:hover  {      background-color : #7d1e1e; } button.accordion:after  { /* Unicode character...