anmarti
anmarti

Reputation: 5143

how to vertical align jQuery button text?

I've modifyed a bit the height of ui-buttonclass but the text button remains at the bottom of it. How can I align it to the middle?

.ui-button {
   display: inline-block;
   position: relative;
   padding: 0px;
   margin-right: 0.1em;
   cursor: pointer;
   text-align: center;
   overflow: visible;
   // resize a bit the height
   height: 20px;
}

vertical-align didn't work.

http://jsfiddle.net/PM4T6/

Upvotes: 0

Views: 3951

Answers (3)

Jassi Oberoi
Jassi Oberoi

Reputation: 1424

try this

.ui-button {
   display: table-cell;
   position: relative;
   padding: 0px;
   margin-right: 0.1em;
   cursor: pointer;
   text-align: center;
   overflow: visible;
   height: 50px;
}

Upvotes: 0

bobthyasian
bobthyasian

Reputation: 943

When using position be sure to specify top left, bottom right....

Upvotes: 0

Rajiv007
Rajiv007

Reputation: 1136

.ui-button {line-height: 20px;}

Upvotes: 2

Related Questions