2013-04-24 91 views
1

好吧,這是一個訂閱箱,裏面有我正在製作的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> 

如果採用保證金歡迎使用屬性全身被轉移 ,如果我不把圖像中的背景,在身體creatig,這樣我可以不寫的確切文本右除圖片。

+0

你能附上一個屏幕截圖嗎? – Sikander 2013-04-24 13:56:18

+0

你能爲我們提供一個jsfiddle嗎? – 2013-04-24 13:56:21

+0

http://jsfiddle.net/bune_dev13/wk99d/1/ 圖像卡在某處,位於extremetext左側sometext2的下方。我怎麼這麼試過,沒有發生:( – 2013-04-24 14:03:21

回答

4

我認爲這可以讓你在正確的方向:

如果使用img標籤,然後這應該工作

#img1_1 { 
    margin-left: 20px; 
} 

,如果你使用的背景圖像,你應該使用後臺位置:

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

沒有冒犯,但我建議您進一步深入CSS和HTML,因爲這是一個非常基本的CSS問題。

+0

謝謝你ruben \ m/ – 2013-04-24 14:05:35

+0

需要15個聲望投票,我沒有那麼多。對不起。 – 2013-04-24 17:17:32