IE7 is clipping my text. How do I adjust its attitude?

前端 未结 10 671
小蘑菇
小蘑菇 2021-02-07 07:39

A few days ago I re-skinned my website. Development of this skin was primarily done using safari, and as expected, it all renders fine using firefox and opera. I\'ve had to make

10条回答
  •  死守一世寂寞
    2021-02-07 07:50

    There's a hack I figured out that fixes the problem of cutting off text in IE. I noticed the last line in my headline was the only one being cut off.

    My original CSS which was cutting off the last line in IE7 but looked fine in other browsers:

    h2 {
       font-size: 22px;
       line-height: 1em;
    }
    

    See image of problem here: https://skitch.com/pablohart/f4g3i/windows-7-x64

    The fix I did included simply adding padding to the bottom and then taking that padding back with negative margin. Like this:

    h2 {
       font-size: 22px;
       line-height: 1em;
       padding-bottom: 5px;
       margin-bottom: -5px;
    }
    

    See picture of fix in this image: https://skitch.com/pablohart/f4g4h/windows-7-x64

    The problem with line-height: normal; is that it takes on the default line-height for the font, usually 1.3em.

提交回复
热议问题