Search code examples
twitter-bootstraptwitter-bootstrap-3accordionvertical-alignmentjquery-ui-accordion

vertically center bootstrap accordion


I am trying to center the accordion content vertically when it is opened, so whatever is in there is displayed in the center of the screen; the code can be seen via dev tools at www.webwoods.co.uk/lsss/installation.html

would prefer a CSS solution, JS if no choice


Solution

  • You could try this (it works for me):

    To .panel-body, .col-md-8 and .col-md-4 add "display: table-cell;" and to .col-md-8 and .col-md-4 - "float: none; vertical-align: middle;"

    note: .panel-default > .panel-heading + .panel-collapse .panel-body -- will overwritte simple .panel-body