background

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

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

復(fù)數(shù): backgrounds

image

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

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

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

第三人稱單數(shù): images 復(fù)數(shù): images 現(xiàn)在分詞: imaging 過去式: imaged 過去分詞: imaged

css background-image屬性 語(yǔ)法

background-image屬性怎么用?

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

作用:為元素設(shè)置背景圖像。

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

注釋:任何版本的 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>

運(yùn)行實(shí)例 ?

點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例