Bootstrap 5 Accordion With Arrow Up And Down

Bootstrap 5 accordion with arrow up and down icon example. By using this Bootstrap accordion we can add a faq section on the website. FAQ accordion is created as 2 columns layout with 2 faq lists.

Related Snippets

Add HTML

<section class="faq-section">
    <div class="container" data-aos="fade-up">
        <header class="section-header">
            <h3>F.A.Q</h3>
            <h2>Frequently Asked Questions</h2>
        </header>
        <div class="row">
            <div class="col-md-5 offset-md-1">
                <div class="accordion accordion-flush" id="faqlist1">
                    <div class="accordion-item">
                        <h2 class="accordion-header">
                            <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#faq-content-1">
                            What is Lorem Ipsum?
                            </button>
                        </h2>
                        <div id="faq-content-1" class="accordion-collapse collapse" data-bs-parent="#faqlist1">
                            <div class="accordion-body">
                                Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.
                            </div>
                        </div>
                    </div>
                    <div class="accordion-item">
                        <h2 class="accordion-header">
                            <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#faq-content-2">
                            Why do we use it?
                            </button>
                        </h2>
                        <div id="faq-content-2" class="accordion-collapse collapse" data-bs-parent="#faqlist1">
                            <div class="accordion-body">
                                It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here.
                            </div>
                        </div>
                    </div>
                    <div class="accordion-item">
                        <h2 class="accordion-header">
                            <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#faq-content-3">
                            Where does it come from?
                            </button>
                        </h2>
                        <div id="faq-content-3" class="accordion-collapse collapse" data-bs-parent="#faqlist1">
                            <div class="accordion-body">
                                Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-5">
                <div class="accordion accordion-flush" id="faqlist2">
                    <div class="accordion-item">
                        <h2 class="accordion-header">
                            <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#faq2-content-1">
                            Where can I get some?
                            </button>
                        </h2>
                        <div id="faqlist2-content-1" class="accordion-collapse collapse" data-bs-parent="#faqlist2">
                            <div class="accordion-body">
                                There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable.
                            </div>
                        </div>
                    </div>
                    <div class="accordion-item">
                        <h2 class="accordion-header">
                            <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#faq2-content-2">
                            The standard Lorem Ipsum passage?
                            </button>
                        </h2>
                        <div id="faqlist2-content-2" class="accordion-collapse collapse" data-bs-parent="#faqlist2">
                            <div class="accordion-body">
                                "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.
                            </div>
                        </div>
                    </div>
                    <div class="accordion-item">
                        <h2 class="accordion-header">
                            <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#faq2-content-3">
                            1914 translation by H. Rackham?
                            </button>
                        </h2>
                        <div id="faqlist2-content-3" class="accordion-collapse collapse" data-bs-parent="#faqlist2">
                            <div class="accordion-body">
                                "But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth.
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>

Add CSS

This CSS is not mandatory to make the Bootstrap accordion, because this CSS is just used to make it a stylish and more attractive FAQ section.

.section-header {
    text-align: center;
    margin: 40px 0px 80px;
}
.section-header h3 {
    font-size: 22px;
    color: #2196f3;
    text-transform: uppercase;
}
.section-header h2 {
    font-size: 32px;
    color: #292929;
    position: relative;
}
.section-header h2:after {
    content: "";
    height: 3px;
    max-width: 100%;
    width: 120px;
    background: #2196f3;
    position: absolute;
    bottom: -25px;
    left: 0;
    right: 0px;
    margin: 0 auto;
}
.faq-section .accordion-collapse {
    border: 0;
}
.faq-section .accordion-button {
    padding: 15px 0px 15px;
    font-weight: bold;
    border: 0;
    font-size: 18px;
    color: #333333;
    text-align: left;
    border-bottom: 1px solid #ddd; 
}
.faq-section .accordion-button:focus {
    box-shadow: none;
}
.faq-section .accordion-button:not(.collapsed) {
    background: none;
    color: #1b6ce5;
}
.faq-section .accordion-body {
    padding: 15px 0px 15px;
}

Leave a Comment