line-height 2px lower in firefox vs webkit

前端 未结 2 1008
南方客
南方客 2020-12-18 04:33

I have the following css:

.btn_container {
cursor: pointer;
font-family: Tahoma,Verdana,Arial;
font-size: 11px;
padding: 0;
width: auto;
}

.btn_center {
bac         


        
2条回答
  •  再見小時候
    2020-12-18 05:05

    I had the opposite experience actually. I noted that some header elements were positioned higher in IE7/compatibility mode as well as Chrome/Safari. So after much trouble I inspected with chrome and saw -webkit-margin-before: 1.6em or something added to the headers. Adding that value and tweaking it didn't work because it effected the height of the header which pushed some elements down but the padding option worked well for me ...

    I found that this worked for me:

    H1, H2, H3, H4, H5, a.mainTab div {
      -webkit-padding-before: 1px;
    }
    

    a.mainTab div had spans which wouldn't respond to the padding/margin so wrapped them in a div ... this may work for li span span headers as well.

提交回复
热议问题