Image img链接下方的额外空间。垂直对齐,线条高度:0不固定。

Image img链接下方的额外空间。垂直对齐,线条高度:0不固定。,image,alignment,Image,Alignment,正在尝试对齐容器左下方的div中的img。。。除了一个神奇的空间出现!我四处搜索这个问题的答案,却发现显示:块和线条高度:0。。。但它们不起作用!有什么想法吗 HTML: <div id="container"> <div id="block"> <a href="home.html"><img src="Thumbs/coffeecup.JPG" width="95" height="80" alt="COFFEE

正在尝试对齐容器左下方的div中的img。。。除了一个神奇的空间出现!我四处搜索这个问题的答案,却发现显示:块和线条高度:0。。。但它们不起作用!有什么想法吗

HTML:

<div id="container">

   <div id="block">
       <a href="home.html"><img src="Thumbs/coffeecup.JPG" width="95" height="80"
        alt="COFFEE CUP JPG" title="" /></a>

   </div>

</div>

我已经试过了所有其他帖子的例子。不知道怎么了

div的宽度为100px,高度为100px,但图像的高度为80px,宽度仅为95px。因此出现了空白。只需删除块的属性width:100px和height:100px,空白就会消失。

Champion。太简单了,我的新手眼睛错过了!谢谢你,伙计。
#container {width:500px;
            height:500px;
            border:solid 1px;
            border-color:#000000;
            margin: 0 auto;
            position:relative; }

#block {width:100px;
        height: 100px;
        border:solid 1px;
        border-color:#000000;
        position:absolute;
        left:0;
        bottom:0;
        }

img {vertical-align:bottom;
     display:block; 
     line-height:0;
     }