當(dāng)前位置:軟件學(xué)堂 > 資訊首頁 > 網(wǎng)絡(luò)編程 > DIV+CSS > table背景圖片屬性backgroulld

table背景圖片屬性backgroulld

2012/11/20 10:10:10作者:佚名來源:網(wǎng)絡(luò)

移動端

【實例介紹】

table背景圖片屬性backgroulld

除了可以為表格設(shè)置背景顏色外,還可以為表格設(shè)置美觀的背景圖像??梢允褂萌魏蔚腉IF或者JPEG圖片文件。

【基本語法】

<table background="背景圖片路徑">

【語法介紹】

背景圖片的路徑可以為相對路徑,也可以為絕對路徑。

【實例代碼】

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>表格的背景圖片屬性</title> </head> <body> <table border="5"align="center"height="100"width="400"

background="images/bottombg.jpg">   <tr>     <td>單元格1</td>     <td>單元格2</td>   </tr>   <tr>     <td>單元格3</td>     <td>單元格4</td>   </tr> </table> </body> </html>

【代碼分析】

在代碼中,加粗的background=”images/bottombg.jpg”標(biāo)記將表格的背景圖像設(shè)置為bottombg.jpg,在瀏覽器中預(yù)覽,效果如圖所示。

背景圖片屬性backgroulld運行效果

 【素材及源碼下載】

請點擊:table背景圖片屬性backgroulld 下載本實例相關(guān)素材及源碼

 

標(biāo)簽: table  背景圖片  屬性