简体   繁体   English

如何垂直对齐jQuery按钮文本?

[英]how to vertical align jQuery button text?

I've modifyed a bit the height of ui-button class but the text button remains at the bottom of it. 我修改了一下ui-button类的高度,但文本按钮仍然在它的底部。 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. vertical-align不起作用。

http://jsfiddle.net/PM4T6/ http://jsfiddle.net/PM4T6/

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

当使用position一定要指定top leftbottom right ....

try this 尝试这个

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM