图像粘在左边

时间:2013-04-24 13:52:50

标签: html css

好的,所以这是一个我正在制作的fancybox的订阅框,一切进展顺利。 这里只是一个小问题。 我使用的图像粘在左边,偶数边缘属性没用。

<style type="text/css">
    body{
        background-image:url(../../images/subscribe.png);
        background-repeat:no-repeat;
        background-position:left bottom;
        margin-bottom:85px;
        line-height:2px;
        margin-left:10px;
        margin-right:10px;

    }
    #h1_1 {

        something;

    }
    #h1_2 {
        something;
    }
    #h1_3 {
        something;

    }

/*
    #img1_1 {
        background-position:left bottom;
        margin:0px;
        background-repeat:no-repeat;

    }
    */

    </style>
    </head>
    <body>


        <p id="h1_1">
        <b>Subscribe Us</b>
        <br>
        <p id="h1_2"> Sometext</p><!-- end h1_2 -->

        <p id="h1_3"> sometext</p><!-- end h1_3 -->
        </p> <!-- end h1_1 -->

     <!--   <img src="../../images/subscribe.png" id="img1_1">  -->

    </body>
    </html>

如果应用保证金比例,整个身体都会转移 如果我不把图像放在背景中,在身体上褶皱,这样我就无法在图像旁边写出确切的文字。

1 个答案:

答案 0 :(得分:4)

我认为这会让你朝着正确的方向前进:

如果你使用img标签,那么这应该可行

#img1_1 {
    margin-left: 20px; 
}

如果您使用背景图像,则应使用背景位置:

body {
    background-position: 20px 20px;
}

没有冒犯,但我建议你进一步深入CSS和HTML,因为这是一个非常基本的CSS问题。