Horizontal accordion div goes down when reducing the window size
-
06-04-2021 - |
Question
I am using a horizontal accordion based on this website:
http://www.marghoobsuleman.com/mywork/jcomponents/accordion-common/accordion.html
If you reduce the window size the accordion will wrap down; it will not fit inside the window.
Expected :
<div></div> <div></div> <div></div>
On a large window size this works fine, but on reducing window size, it will display like this:
<div></div>
<div></div>
<div></div>
La solution
To prevent the divs
from wrapping, you would really need to wrap the accordion itself in an element with defined width.
Add this to your CSS:
.accordionWrapper { width: 689px; }
Autres conseils
It's because wrapper div
automatically shrink when you reduce window's size.
Set width on wrapper.
.accordionWrapper { width: 689px; }
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow