search

Home  >  Q&A  >  body text

css - 安卓内嵌H5,padding边距上下不一致

<span>管理员</span>
    border-radius: .07rem;
    padding: .05rem .1rem;
    color: #fff;
    background-color: #EE3120;

PC上是正常的,安卓webview里明显上下边距不一致,除了修改padding top和bottom的值,还有别的解决办法吗

黄舟黄舟2772 days ago1164

reply all(5)I'll reply

  • 迷茫

    迷茫2017-04-17 18:02:51

    Solved, using button as a container will not cause this problem

    reply
    0
  • 迷茫

    迷茫2017-04-17 18:02:51

    Lower versions of Android are not well supported. . .

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 18:02:51

    Remove padding and directly use line-height to set the span height.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 18:02:51

    <span style="height: 30px;line-height: 30px;display:inline-block;padding:0px 10px;border-radius: 5px;color: #ffffff;background-color: #EE3120;">Try Give it a try</span>
    It’s very simple, I wrote it together, it looks like this on the phone

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 18:02:51

    1, reset the vertical alignment of the font; vertical-align: baseline;
    2, turn off font optimization; -webkit-text-size-adjust: 100%;
    3, set the default font of the device; for example: font-family: sans -serif;

    This is basically OK; (except for Android with custom font roms like Meizu)

    reply
    0
  • Cancelreply