如何去除html之间的差距? [英] How to remove the gap between div in html?

查看:100
本文介绍了如何去除html之间的差距?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我被这个问题困住了,无法摆脱这个问题。请帮助我。





在我的网页中,我在容器div中使用了3个div。我试图去除div之间不需要的空隙。



$ ul
  • (1)Top bg image

  • (2)中间bg图片
  • bg image


    我试图调整这3个div,使其看起来像一个bg图像。我的中间部分和底部部分是完全调整的,但上半部分和中间部分之间有一定的差距,我正尝试删除但无法删除。

    请参阅图像,我已经附上了这里,它显示了顶部和中间部分之间的差距。请参考我用于放置图像的样式表数据。



    预先致谢

    p>

      #main_container {
    background-repeat:no-repeat;
    width:645px;
    float:left;
    padding-bottom:10px;
    overflow:hidden;
    height:auto;
    }
    #middle_part {
    background-image:url('/ DiscoverCenter / images / apps_mid.png');
    background-repeat:repeat-y;
    width:645px;
    padding-bottom:10px;
    overflow:hidden;
    height:auto;
    明确:两者;
    职位:亲属;
    display:block;
    vertical-align:bottom;
    }
    #top_part {
    background-image:url('/ DiscoverCenter / images / apps_top.png');
    width:645px;
    top:0px;
    height:47px; / *顶部bg图像的实际高度* /
    clear:both;
    职位:亲属;
    display:block;
    vertical-align:bottom;
    }
    #bottom_part {
    background-image:url('/ DiscoverCenter / images / apps_btm.png');
    width:645px;
    height:24px; / *底部bg图片的实际高度* /
    }


    解决方案 div>

    这是Top bg图像大小的问题。图像的大小是45像素,我把它的div的大小为47像素。通过减小div的大小解决了我的问题。非常感谢Dawson和DBz的帮助。


    I am stuck with this problem and not able to come out of this. Please help me.

    In my webpage, I have used 3 divs inside a container div.I am trying to remove the unwanted gap between the div.

    • (1)Top bg image
    • (2)Middle bg image
    • (3)Bottom bg image

    I am trying to adjust these 3 divs so that it can look like one bg image. My middle part and bottom part are adjusted completely but top part and middle part have some gap in between that i am trying to remove but not able to.

    Please refer to the image which i have attached here which shows the gap between top and middle part.Please refer the stylesheet data I had used for placing the images.

    Thanks in advance.

    #main_container {
        background-repeat:no-repeat;
        width:645px;
        float:left;
        padding-bottom:10px;
        overflow:hidden;
        height:auto;
    }
    #middle_part {
        background-image: url('/DiscoverCenter/images/apps_mid.png');
        background-repeat:repeat-y;
        width:645px;
        padding-bottom:10px;
        overflow:hidden;
        height:auto;
        clear:both;
        position:relative;
        display: block;
        vertical-align: bottom;
    }
    #top_part {
        background-image:url('/DiscoverCenter/images/apps_top.png');
        width:645px;
        top:0px;
        height:47px;  /* actual height of the top bg image */
        clear:both;
        position:relative;
        display: block;
        vertical-align: bottom;
    }
    #bottom_part {
        background-image:url('/DiscoverCenter/images/apps_btm.png');
        width:645px;
        height:24px; /* actual height of the bottom bg image */
    }
    

    解决方案

    It was the Problem with the Top bg image size. Size of the image is 45 pix and I took it the size of the div as 47 pix. By decreasing the size of the div had solved my problem.Thanks a lot to Dawson and DBz for the help.

    这篇关于如何去除html之间的差距?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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