css background-image和layer-background-image的區別

來源:互聯網
上載者:User
layer-background-image

文法:

layer-background-image : none | url (url)

參數:

none :  無背景圖
url :  使用絕對或相對位址指定背景映像

說明:

設定或檢索對象整個地區的背景映像。

樣本:

code { position: absolute; top: 100px; left: 300px; width: 200px; border: thin solid black; background-image: url("comet.jpg"); layer-background-image: url("bb_comet.jpg"); }

用css樣式設定圖層的 background-image 和 layer-background-image有什麼區別?

前者是W3C標準裡的樣式, 後者只是 Netscape 瀏覽器自己的專用寫法, 建議向W3C標準靠攏.

background-image針對於整個網頁.
在網頁中設定了層.如浮動塊(不是視窗)那麼背景就是layer-background-image了
說實話 差別不大,建議你用background-image 不要用layer-background-image
沒多大用
layer-background-image 在IE6以下包含(IE6) 不被支援!

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.