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

table背景顏色屬性bgcolor

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

移動(dòng)端

【實(shí)例介紹】

table背景顏色屬性bgcolor

bgcolor屬性規(guī)定表格的背景顏色。定義顏色的時(shí)候,可以使用英文顏色名稱或十六進(jìn)制顏色值表現(xiàn)。

【基本語法】

<table bgcolor="背景顏色">

【語法介紹】

bgcolor是針對(duì)整個(gè)表格的,不過會(huì)被行、列或單元格定義的背景顏色所覆蓋。

【實(shí)例代碼】

<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" bgcolor="#E68E46">   <tr>     <td>單元格1</td>     <td>單元格2</td>   </tr>   <tr>     <td>單元格3</td>     <td>單元格4</td>   </tr> </table> </body> </html>

【代碼分析】

在代碼中,加粗的bgcolor="#E68E46"標(biāo)記將表格的背景顏色設(shè)置為#E68E46,在瀏覽器中預(yù)覽,效果如圖所示。

背景顏色屬性bgcolor運(yùn)行效果

 【素材及源碼下載】

請(qǐng)點(diǎn)擊:table背景顏色屬性bgcolor 下載本實(shí)例相關(guān)素材及源碼

 

標(biāo)簽: table  背景  顏色