Christopher
Christopher

Reputation: 3469

CSS - How to align <span> content to middle using bootstrap?

I'm experiencing some issues while i'm trying to put <span> content aligned to middle:

enter image description here

I'm using bootstrap and i want to align middle the price value or No price found. Ask price.

Demo: https://jsfiddle.net/3erhxr1j/

Upvotes: 0

Views: 485

Answers (1)

amespower
amespower

Reputation: 917

See the updated fiddle: https://jsfiddle.net/3erhxr1j/2/ By adding equal height and line height to the wrapping div, you can then center what's inside with vertical align.

.text-center.col-xs-12.col-sm-3{
   height: 120px;
   line-height: 120px;
}

h3{
    display: inline-block;
    vertical-align: middle;
    line-height: normal;
}

Upvotes: 2

Related Questions