background

英 [?b?kgra?nd]? ?美 [?b?k?ɡra?nd]??

n.(畫等的)背景;底色;背景資料;配樂

復數: backgrounds

image

英 [??m?d?]? ?美 [??m?d?]??

n.影像;肖像;概念,意向;鏡像,映像

vt.反映;想像;作…的像;象征

第三人稱單數: images 復數: images 現在分詞: imaging 過去式: imaged 過去分詞: imaged

css background-image屬性 語法

background-image屬性怎么用?

background-image屬性為元素設置背景圖像,語法為:background-image:url(圖片路徑)。設置的背景圖像會占據元素的全部尺寸,包括內邊距和邊框,但不包括外邊距。

作用:為元素設置背景圖像。

說明:元素的背景占據了元素的全部尺寸,包括內邊距和邊框,但不包括外邊距。默認地,背景圖像位于元素的左上角,并在水平和垂直方向上重復。

注釋:任何版本的 Internet Explorer (包括 IE8)都不支持屬性值 "inherit"。

css background-image屬性 示例

<html>
<head>

<style type="text/css">
body {background-image:url('http://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg');}
</style>

</head>

<body></body>

</html>

運行實例 ?

點擊 "運行實例" 按鈕查看在線實例