I have some buttons with text inside. What I'm trying to do is to align them to middle from vertical and horizontal.On the example I have 3 buttons (the left one is bigger in purpose)
When it a long text its placed on some rows on the middle of the button - it is not starting from the vertical middle but looks fine, but when I get short text it ("oneWord") then attached to the top side and all looks messy.
I read some exampels:
How do I vertically align something inside a span tag? Button's text vertical align
How do I vertically align something inside a span tag?
vertical-align:middle for text in button
After all this I set my style to:
.spanContainer {
height: 70px;
}
.spanContainer span {
height: 70px;
display: table-cell;
vertical-align: middle;
white-space: normal;
}
After All the changes I'm getting those result:
On vertical side it is in middle(short and long text) - O.K, but on the horizontal for short text it start from the left side
The problem is that display: table-cell
float it to left side for short text!
How can I create those buttons so even if I have one word or a long text they all will start on the middle of the button on horizontal and vertical?