Vertical alignment of text in container: WebKit vs Firefox

前端 未结 4 632
忘了有多久
忘了有多久 2020-12-13 11:12

The problem is that Firefox and WebKit based browsers seem to align text vertically in different ways when contained in an element that has an even height/line-height and th

4条回答
  •  难免孤独
    2020-12-13 12:07

    This is browser rendering issue. Use line-height 1px less than the given height, for example:

        .box
    {
       background-color: Blue;
       color: White;
       font-family: Helvetica,Arial;
       font-size: 15px;
       height: 18px;
       line-height: 17px;
       width: 60px;
    }
    

提交回复
热议问题