解决 Android 系统 设置line-height和height相同,文字却偏上显示(pc端和ios都显示ok)

问题:
在这里插入图片描述
代码:

    width: 36px;
    height: 20px;
    line-height: 20px;
    position: absolute;
    top: 14px;
    right: 14px;
    color: #fff;
    background: #F87D28;
    border-radius: 2px;
    font-size: 14px;
    text-align: center;

解决方案:

    width: 36px;
    line-height: normal;
    position: absolute;
    top: 14px;
    right: 14px;
    color: #fff;
    background: #F87D28;
    border-radius: 2px;
    font-size: 14px;
    text-align: center;

效果图:
在这里插入图片描述

总结:
将行高属性值改成normal就好了
line-height: normal;

猜你喜欢

转载自blog.csdn.net/wcy7916/article/details/83345705