支援CSS1 以上
用法: background-image
background-image: url('圖片路徑');
說明:
background-image 設定背景圖
css定義:
body{
background-image: url('66img.jpg');
}
注意事項:
JavaScript 用法:
object.style.backgroundImage="url(圖片路徑)"
程式:
<!DOCTYPE html>
<html>
<head>
<title>CSS background-image 套用樣式 背景圖</title>
<meta http-equiv="Content-Type" content="text/html; charset=BIG5">
<style type="text/css">
body{
background-image: url('66img.jpg');
}
</style>
</head>
<body>
<div id="div1">
CSS background-image;
</div>
</body>
</html>
圖1:
背景圖
測試結束~
如果還不了解可參考:w3schools CSS background-image Property
感謝~
其它文章


沒有留言:
張貼留言