I\'m using Twitter Bootstrap 3, and I have problems when I want to align vertically two div
, for example — JSFiddle link:
This answer presents a hack, but I would highly recommend you to use flexbox (as stated in @Haschem answer), since it's now supported everywhere.
Demos link:
- Bootstrap 3
- Bootstrap 4 alpha 6
You still can use a custom class when you need it:
.vcenter {
display: inline-block;
vertical-align: middle;
float: none;
}
Big
Small
Bootply
Using inline-block
adds extra space between blocks if you let a real space in your code (like ...
Big
Small
Here, we've got extra spaces between Let's kick this extra space!! Notice the seemingly useless comments Note: the Bootply has been updated? They are important -- without them, the whitespace between the