IE9 img hover add's margin to bottom

纵然是瞬间 提交于 2019-12-11 07:11:41

问题


I'm having a very strange problem and have no clue on how to solve it. The webpage on where the problem occurs has a div which has several clickable images horizontal in it. When hovering the clickable images () a border of 15 pixels changes color, when leaving the hovered state the border color changes again to the original color. The weird issue is that when I hover any image in the div or leave the hover state, the margin under the div keeps enlarging, which is ofcourse unacceptable. This problem only occurs in IE9. Chrome and Firefox work fine. I haven't tested on previous IE versions. I think the problem might be in the following CSS statements:

#content_links #fotos #foto{
    text-align: center;
    width: 488px;
    overflow-y: hidden;
    white-space: nowrap;
    margin-left: 22px;
    margin-bottom: 70px;
}

#content_links #fotos #foto a{
    text-decoration: none;
}

#content_links #fotos #foto img{
    margin-left: 3px;
    margin-right: 3px;
    margin-bottom: 6px;
    border: 3px solid silver;
    border-bottom-width: 15px;
}

#content_links #fotos #foto a:hover img{
    border: 3px black solid;
    border-bottom-width: 15px;
}

Any clues on solving this problem? Thanks in advance,

Thomas


回答1:


Have you declared a doctype for your html? I have noticed strange things with IE and borders without one. I am not sure this applies to IE 9.

See here on css and compatability with internet explorer.



来源:https://stackoverflow.com/questions/6534390/ie9-img-hover-adds-margin-to-bottom

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