How can I create an accordion with CSS and HTML only? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

How can I create an accordion with CSS and HTML only?

If I click a button, the accordion will appear.

4th Jul 2018, 11:15 AM
B.D
B.D - avatar
9 Answers
+ 7
Bithi D yes, of course. Do you want to create an accordion or an accordion menu?
4th Jul 2018, 12:40 PM
Mattéo
+ 6
Okay, yes you can do it with CSS and JS
4th Jul 2018, 1:08 PM
Mattéo
+ 5
Hello, Bithi D ! If you want to do this only with css and html, you can do it this way <style> button:hover { background-image:url("Accordion.png"); background-repeat:no-repeat; background-size:100% 100%; } </style> <button>Click</button>
4th Jul 2018, 11:31 AM
Alexander Sokolov
Alexander Sokolov - avatar
5th Jul 2018, 9:20 AM
Mattéo
+ 3
Here the CSS accordion that resembles Bootstrap accordian https://code.sololearn.com/WgcjJl8Psruc/?ref=app
5th Jul 2018, 4:24 AM
Calviղ
Calviղ - avatar
+ 3
thanks
5th Jul 2018, 9:08 AM
B.D
B.D - avatar
+ 1
thank you
4th Jul 2018, 12:28 PM
B.D
B.D - avatar
+ 1
Can I use text instead of image?
4th Jul 2018, 12:29 PM
B.D
B.D - avatar
+ 1
accordion menu
4th Jul 2018, 12:47 PM
B.D
B.D - avatar