-
-
Notifications
You must be signed in to change notification settings - Fork 79k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collapse accordion toggle header - increase clickable area #22114
Comments
Turn the |
Sorry for reviving an older issue. I am still unable to get this effect in v4.1 after following the examples in https://getbootstrap.com/docs/4.1/components/collapse/#accordion-example. Is there anything I need to add? |
@amard33p Scroll down and view my after example that follows Mark's suggestion of using an anchor instead of a div. |
@JacobLett But that needs custom CSS right? I mean there's some code in the CSS section in the pen. |
@amard33p I forked my example and removed the custom classes. I replaced those with some Bootstrap utility classes. https://codepen.io/JacobLett/pen/VqgwZW To summarize the changes: Used an anchor tag to add a cursor pointer on hover, but anchors are inline elements so we needed to add a d-block class to make the anchor act like a div and display block. The red outline shows the clickable area. Let me know if you have more questions. |
Awesome! Thank you very much! |
If you test the accordion snippet and click on the heading to the far right where there is no anchor text the toggle does not open. I think the clickable area should be as big as possible.
Demo of issue and proposed solution: http://codepen.io/JacobLett/pen/GWqjPw
A CSS solution would be to create a new .collapse-accordion class to apply unique styling to the card header and anchor toggle.
Or with javascript make the .card-header clickable and grab the href inside it if one exists.
What do you think?
The text was updated successfully, but these errors were encountered: