简体   繁体   English

CSS在Internet Explorer中无法正常工作? (绝对定位)

[英]CSS not working properly in Internet Explorer? (absolute positioning)

Plenty of other things on the page are using the absolute positioning as well, but for some reason the "vote" and "profile" buttons are displaying several hundred pixels to the right and about fifty pixels up in Internet Explorer 9/10 (8- is not an issue here). 页面上的许多其他内容也都使用绝对定位,但是由于某些原因,“投票”和“配置文件”按钮在Internet Explorer 9/10中向右显示数百个像素,向上方显示大约50个像素(8-在这里不是问题)。 There is no styling in the HTML, it's all right here. HTML中没有样式,就在这里。 Anything that stands out? 有什么特别的吗? Thanks! 谢谢!

        .contain{
        margin-left:-65px;
        margin-top:-85px;
        position:absolute;

    }
    .video_display1{
        background-color:#333;
        width:250px;
        height:200px;
        margin-top:40px;
        margin-left:88px;
    display:inline;
    }
    .profile1{
        width:49px;
        height:12px;
        margin-left:87px;
        margin-top:3px;
        position:absolute;
    }
    .vote1{
        margin-top:3px;
        margin-left:240px;
        position:absolute;
    }
    .display_vote1{
        margin-left:295px;
        margin-top:2px;
        font-size:11px;
        position:absolute;
    }

And here's the HTML: 这是HTML:

            <span class="contain">
                <iframe class="video_display1" width="250" height="200" src=""> </span>
                <span class="profile1"><img src=''/></span>     
                <span class="vote1"><input type="image" src=''/></span>             
                <span class="display_vote1"></span>
            </span>

And the DOCTYPE: 和DOCTYPE:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

You have not defined width and height of images, so to get fixed height & width define it first. 您尚未定义图像的宽度和高度,因此要获得固定的高度和宽度,请先对其进行定义。 And use display: inline-block; 并使用display: inline-block; in your .contain then only you get what you want. 在您的.contain只有您得到想要的东西。

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

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