Theoretically, an accordion is a perpendicular list of titles. Whenever someone clicks on the title header, it reveals the information or the collapsible element associated with it at the bottom of the title. Again when clicking on the header title, it hides the collapsible element related to it. This Component is widely used on most websites nowadays to showcase the FAQs, Specifications, and so on of any company. Watch the video tutorial below for more details.
Video Tutorial:
For the accordion title or card header, We used some designation name examples like Chief Executive Officer, General Manager, etc. We have taken some random names, dummy text as description, and some social media icons from font awesome for the information or the card body section. The images we have used for this snippet are 300px in width and 300px in height. So all the photos are square shape images.
We have given a nice-looking gradient color in the card header or the accordion to give it a professional look. We used a gradient color for the social media button background and the separator line between the name and description. We have used bootstrap grid column classes to make the image and information of that image remain right and left side of the card body. After the name and some info text, we have provided four social media icons from font-awesome in div named socials. We did the same markup for the other two card-body classes.
The accordion will automatically work as we have Bootstrap for the project. We have customized it for the way it looks. We have styled some elements like social media buttons, card-header text, card-body features, etc.
To make the snippet mobile responsive, we have to make some adjustments. First, we make the image width 100%, followed by decreasing the font size of the card-header class button. Then we provided a margin-bottom value for the socials class so that they maintain a 30px distance in the mobile view.
You may also like:
Responsive Team Accordion using Bootstrap (Source Code):
To create this snippet, you need to copy the HTML and CSS code from the code box and paste the code to the appropriate files, and save them. If the code doesn't work, you can download the code from the download button below this blog post.
ADD HTML:
ADD CSS:
We hope the code is working for you. For more, please click the load more button on our homepage. Thanks for visiting the blog and keep visiting for more like this. Follow our Facebook and Twitter group to keep updated.
Post a Comment
Please do not enter any spam link in the comment box.