This is best suited for a site on smaller devices. The accordion is seen in smaller screens, whereas the tabs are seen in larger screens. HTML is simple with the ordered list set in the tags. The CSS styling is set for each tag which gives a tab and accordion view as per the screens used to view the page. This behavior is given due to the CSS styling and javascript. The javascript takes care of activating and deactivating the tabs once click. It also gives an accordion kind of look by adding the active class when needed. The script is carefully written to enhance the responsive behavior in smaller screens. Display for smaller screens is taken by CSS file using @media screens. Each and every file has a responsibility well divided to make this snippet function. You can use this snippet for mobile applications.
This is an excellent example of the accordion with “expand all and collapse all” button. The HTML is simple with the bootstrap accordion with the panel and data-toggling behavior defined. The CSS defined the styles for each tag, check out the “:: after” selector tag, which selects the panel-default and panel-heading and add the given styles after they are selected. Notice the change in the expandable button which is at the right of accordion, once clicked it rotates 180deg, this styling is done using CSS for aria-expended. This indicates the state of the collapsible element. This aria-expanded can be used with menus or list or any other collapsible items. The expand all and collapsible all button work using javascript. Check out the functions which open up all the accordion when clicked on "expand all" and "close all" when clicked on close all accordion. Use this to your website with large content and paragraphs.