为什么Opera 9中有这两个图像之间的空间? [英] Why does Opera 9 have a space between these two images?

查看:94
本文介绍了为什么Opera 9中有这两个图像之间的空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

其他浏览器正确地呈现这一点。

 <身体GT;
    < D​​IV>
        < D​​IV>< IMG SRC =IMG / logo_top.pngWIDTH =168HEIGHT =85ALT =标志顶/>< / DIV>
        < D​​IV>< IMG SRC =IMG / logo_bottom.pngWIDTH =168HEIGHT =83ALT =标志下方的/>< / DIV>
    < / DIV>
< /身体GT;

这是没有的div同样的事情,并用<图像之间BR />

更新:

下面是我的HTML,与文档类型:

 <!DOCTYPE HTML PUBLIC -  // W3C // DTD XHTML 1.1 // EN
    http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">
< HTML的xmlns =htt​​p://www.w3.org/1999/xhtmlXML:LANG =ENGT&;
    < HEAD>
        <标题>测试与LT; /标题>
        < META HTTP-EQUIV =Content-Type的CONTENT =text / html的;字符集= UTF-8/>
        <风格类型=文/ CSS>
            IMG {边界:无;}
            身体{字体大小:0像素;}
        < /风格>
    < /头>
    <身体GT;
        < D​​IV>
            < D​​IV>< IMG SRC =IMG / logo_top.pngALT =标志顶/>< / DIV>
            < D​​IV>< IMG SRC =IMG / logo_bottom.pngALT =标志下方的/>< / DIV>
        < / DIV>
    < /身体GT;
< / HTML>


解决方案

如果这是我想是的,它应该是固定的,如果你添加这个CSS问题:

  IMG {
    垂直对齐:顶部
}

或者这样:

  IMG {
    显示:块
}

Every other browser is rendering this correctly.

<body>
    <div>
        <div><img src="img/logo_top.png" width="168" height="85" alt="Logo top" /></div>
        <div><img src="img/logo_bottom.png" width="168" height="83" alt="Logo bottom" /></div>
    </div>
</body>

It's the same thing without the divs, and with a < br /> between images.

Update:

Here is my HTML, with doctype:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
    <head>
        <title>Test</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <style type="text/css">
            img {border: none;}
            body {font-size: 0px;}
        </style>
    </head>
    <body>
        <div>
            <div><img src="img/logo_top.png"  alt="Logo top" /></div>
            <div><img src="img/logo_bottom.png" alt="Logo bottom" /></div>
        </div>
    </body>
</html>

解决方案

If it's the issue I think it is, it should be fixed if you add this CSS:

img {
    vertical-align: top
}

Or this:

img {
    display: block
}

这篇关于为什么Opera 9中有这两个图像之间的空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆