Reputation: 138336
I'm trying to vertically center a GitHub button within a fixed top-bar in Bootstrap, but it keeps aligning along the top.
I tried using vertical-align: middle
, but that had no effect.
.github-button {
background: red; /* to visualize size */
vertical-align: middle;
}
If I set the inner element's height and padding, I get the desired placement, but that seems fragile and "hacky".
.github-button > iframe {
padding-left: 13px;
padding-top: 10px;
height: 45px;
}
Here's the fiddle (widen your browser page or the panel size to switch from mobile mode to desktop mode): http://jsfiddle.net/aE9PS/2/
Any ideas on how to implement this cleanly? I'm open to suggestions of 3rd party libraries. Thanks
Upvotes: 1
Views: 265
Reputation: 27614
.github-button {
background: red;
vertical-align: middle;
padding-left: 13px;
padding-top: 7px;
height: 45px;
}
Upvotes: 1