Text-decoration being cut off by overflow:hidden in certain browsers?

血红的双手。 提交于 2020-01-15 10:51:31

问题


So I'm using the OOCSS media module and I'm putting a link inside of it and the last line of the link is being cut off.

To explain for anyone who doesn't know about the framework, it's simple to explain: imagine an element with overflow: hidden, and a link inside that element. That's ALL.

If I put a link inside of this element with overflow: hidden, the last text-decoration line of the link is cut off thanks to overflow: hidden. Without having to resort to padding & margin (and hopefully floats) is there anyway to compensate for that last line being cut off? Chrome seems to get this right, not sure though.


回答1:


Actually there was another question very similar to this recently, you can see my answer there: Html anchor height issue with unitless line heights

So I don't think there's a solution to your question, but I wanted to note that while Chrome gets it right for overflow hidden, when you use overflow auto it's actually a problem as you'll see in that post.




回答2:


try to set the line height on the text

line-height:1.5;


来源:https://stackoverflow.com/questions/7665443/text-decoration-being-cut-off-by-overflowhidden-in-certain-browsers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!