有人知道为什么我的文字不会居中吗?以及我该如何解决?我尝试使用text-align:center,但仍然无法正常工作。



.btn-orange {
    margin-top:10px;
    width: 200px;
    text-align: center !important;
    margin:1px;
    color: #fff;
    background-color: #e3690b;
    border-color: #e3690b;
    padding: 20px 50px 10px 10px;
    border-radius: 10px;
    font-size: 27px;
    font-stretch: ultra-expanded;
    display: inline-block;
    margin-bottom: 0;
    font-weight: 400;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    -ms-touch-action: manipulation;
    touch-action: manipulation;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-image: none;
    border: 1px solid transparent;
}

 <button type="button" class="btn-orange" style="text-align:center !important;">Value<br> My Videos</button>

最佳答案

padding: 20px 50px 10px 10px;

右上,下,左不匹配。

尝试padding: 10px 20px 10px 20px;

关于css - 引导按钮中的居中文字,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/45381428/

10-13 00:47