我知道我接近,但有人幫我出:語法幫助 - 背景圖片精靈的CSS
body {
background-attachment: fixed;
background: url("images/background.jpg"), url("images/background.jpg");
background-repeat: no-repeat;
line-height: 1;
min-width: 1150px;
background-position: top left, bottom right;
}
的圖像被用作一個精靈,「background.jpg」是1720px寬1100px高。我需要在第一個實例中顯示圖像的右上部分,在第二個實例中顯示圖像的左下部分。在每種情況下,需要從jpg中獲取的矩形的大小是600px寬和400px高。
這看起來像一個可疑的http://stackoverflow.com/questions/10364643/css-two-background-images-using-a-sprite轉發與圖像文件名稱換出了別的完全不同的背景位置。 – BoltClock 2012-04-28 15:43:48
雖然這與這篇文章有關,但它是關於選擇圖像的所需座標所需的特定語法的一個新問題 – 2012-04-28 15:45:39