IE7 Line Height issue?

余生颓废 提交于 2019-12-13 05:14:42

问题


I have a link containing a span which should read something like "link +", this displays correctly in all browsers except ie7:

<a style="display: inline; width:200px;" href="">
    Open a ticket
    <span style="float: right">+</span>
</a>

Visit http://jsfiddle.net/nGJ5b/ in ie7 to see what I mean. Has anybody knowledge of a fix for this?


回答1:


You can try and display every element as a block:

<a style="display: block; width:200px;" href="">
    <span style="float: left; display: block;">Open a ticket</span>
    <span style="float: right; display: block;">+</span>
</a>

Of course, this will not be acceptable if you need that link to be inline.




回答2:


Placing the span before any other element seemed to do the trick. http://jsfiddle.net/nGJ5b/1/



来源:https://stackoverflow.com/questions/6355959/ie7-line-height-issue

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