简体   繁体   English

即6<img> in<span>改变行高</span>

[英]ie6 <img> in <span> changes line height

There is a little part of code有一小部分代码

<span class="breadcrumbs pathway">
<a href="somewhere.html" class="pathway">
    link
</a>
<img src="/customs/images/M_images/arrow.png" alt="" />
Архив
</span>

And the problem is that the image height is less than font-size, ant the line, that contains becomes thiner.问题是图像高度小于字体大小,ant 包含的行变得更薄。

Tried to add zoom:1;尝试添加zoom:1; , display:inline-block or inline with no result , display:inline-blockinline没有结果

This thing happens only in ie6这件事只发生在ie6

UPD UPD

Well, thank you all, guys.嗯,谢谢大家。 I have found a solution to set img styles to display:inline-block;我找到了将 img styles 设置为display:inline-block;的解决方案and add a padding-top:0.5em并添加一个padding-top:0.5em

@M2_ I had also faced the same problem. @M2_ 我也遇到了同样的问题。 Try adding reset.css which will reset all the IE styles that browser has by default and you will find here before adding your custom css files.尝试添加reset.css这将重置浏览器默认拥有的所有 IE styles,在添加自定义 css 文件之前,您会在此处找到。 Also create an IE-Only Stylesheet, which will target specifically to IE and for that you can refer this .还要创建一个IE-Only样式表,它将专门针对 IE,为此您可以参考这个. Hope this will help you.希望这会帮助你。

Have you tried to assign vertical-align: middle;您是否尝试过分配vertical-align: middle; to the image?图像?

Try setting the line-height of <span class="bread-crums pathway"> same heigth as the image.尝试将<span class="bread-crums pathway">line-height设置为与图像相同的高度。

Ie. IE。 if the image has 22px如果图像有 22px

.breadcrumbs{_line-height:22px}

sorry, I don't have an IE6 available to test, but have you tried to抱歉,我没有可用于测试的 IE6,但您是否尝试过

  • set the padding and margin to 0?将填充和边距设置为 0? style="padding: 0; margin:0"
  • set the height of the image?设置图像的高度? style="height: 4px"
  • set the border of the image?设置图像的边框? style="border: none" or style="border: 0" style="border: none"style="border: 0"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM