15 Best CSS Accordion Designs You’ve Never 👀 Seen Before
Tags: html, css, javascript, beginners
Published: 2021-07-22 02:44:01

***Hello Friends, I have listed over 15 best css accordion designs made with HTML, CSS, and JS. Check out these excellent accordion examples which are available on Codepen.***

### Awesome Accordion Design 2021 step by step
#### Step 1 — Creating a New Project
In this step, we need to create a new project folder and files(index.html, style.css) for creating a simple accordion design. In the next step, you will start creating the structure of the webpage.

#### Step 2 — Setting Up the basic structure
In this step, we will add the HTML code to create the basic structure of the project.

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>How to create accordion with css only</title>
    <link rel="stylesheet" href="style.css">
    <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@200;400&display=swap" rel="stylesheet">
</head>
<body>
   
</body>
</html>
```
This is the base structure of most web pages that use HTML.

Add the following code inside the `<body>` tag:
```html
 <div class="accordion_outer">
        <div class="container">
            <details>
                <summary>Section 1</summary>
                <div class="details">
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing 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.</p>
                </div>
            </details>
            <details>
                <summary>Section 2</summary>
                <div class="details">
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing 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.</p>
                </div>
            </details>
            <details>
                <summary>Section 3</summary>
                <div class="details">
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing 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.</p>
                </div>
            </details>
            <details>
                <summary>Section 4</summary>
                <div class="details">
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing 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.</p>
                </div>
            </details>
        </div>
    </div>
```

###Step 3 — Adding Styles for the Classes
In this step, we will add styles to the section class Inside style.css file

```css
* {
    padding: 0;
    margin: 0;
    font-family: 'IBM Plex Sans', sans-serif;
}
html,body {
  background: #dae9f9;
}

.container {
  width: 95%;
  max-width: 1140px;
  margin: auto;
}
.accordion_outer {
  padding: 50px 0;
}
details {
  background: #f2f4f6;
  padding: 10px;
  font-size: 18px;
  margin-bottom: 10px;
  cursor: pointer;
}
.details {
  background: #fff;
  padding: 10px;
  margin-top: 10px;
  cursor: auto;
}
```

#### #Final Result

{% youtube z0hXgqV3BXc %}


### Best Collection of Accordion design
In this collection, I have listed over 10+ best accordion designs made with HTML, CSS and JavaScript. Check out these awesome CSS accordion examples which are available on Codepen.

#### #1 Accordion in vanilla js

{% codepen https://codepen.io/cant89/pen/RLEoyV/ %}

#### #2 Pure CSS Accordion 2.0

{% codepen https://codepen.io/raubaca/pen/PZzpVe %}

#### #3 Frontend Mentor | FAQ Accordion Card

{% codepen https://codepen.io/viktoriiazaichuk/pen/xxqJGag %}

#### #4 Multi theme accordion

{% codepen https://codepen.io/briank76/pen/mdWmdaJ %}

#### #5 Bootstrap 5.0 accordion

{% codepen https://codepen.io/bdavisjr/pen/yLMLZwg %}

### <a href="https://blog.stackfindover.com/best-css-accordion-designs-you-have-never-seen-before/">List of css accordion</a>

#### You may like these also:)
1. <a href="https://blog.stackfindover.com/best-stunning-css-fire-animations/">🔥 Best 25+ Stunning CSS Fire Animations 2021</a>
2. <a href="https://blog.stackfindover.com/best-css-card-design-for-website/">100% Free Best CSS Card Design For Your Website</a>
3. <a href="https://blog.stackfindover.com/how-to-build-a-javascript-random-quote-generator/">How to build a JavaScript Random Quote Generator</a>