2013-03-13 268 views
2

CSS中有些東西我不知道?我正在嘗試在屏幕的右下角放置一張圖片。我不知道它爲什麼這樣做,但它似乎將圖像從屏幕上推開,我看不到它。如果我刪除bottom,它會將圖像放在右側,但不會放在底部。如果我做right top圖片顯示在右上角。那麼爲什麼它不顯示在right bottom背景圖片不顯示右下角

*{ 
    box-sizing: border-box; 
    font-family: BentonSans, 'Lucida Sans', 'Lucida Grande', sans-serif; 
    color: rgb(102, 102, 102); 
    outline: none; 
    border: 0; 
} 
body{ 
    font-size: 12pt; 
    padding: 0; 
    margin: 0; 
    background-image: url("/media/images/image1.jpg"); 
    background-position: right bottom; 
    background-repeat: no-repeat; 
} 
+2

怎麼樣演示? – xiaoyi 2013-03-13 00:55:34

回答

6

我懷疑它是與容器大小有關。

你有沒有在你的CSS somehwere?

html, body { 
min-height: 100%; 
min-width: 100%; 

}

+0

是!我也剛剛找到解決方案! – 2013-03-13 00:58:06

+1

我認爲'min-height'和'min-width'會更好。 – 2013-03-13 00:58:47

+0

正確的你是...更新 – hammus 2013-03-13 00:59:33