我有一個圖像有超過100個不同大小和尺寸的幾何形狀,我用它的圖像映射,併爲每個<area>
像<area id="1">
分配ID。我保存記錄MySQL的分貝約像每個形狀:改變HTML的背景顏色<area>標籤
--------------------
box_id | color_code
--------------------
1 #AEEE11
2 #AEEE01
3 #DEEF11
4 #0EE001
--------------------
現在我想設置backgroung顏色爲每個相對於它們的ID。
這裏我粘貼HTML代碼,一些區域如整個頁面會增加我的帖子:
<img src="images/map.gif" border="0" usemap="#Msj_Map" alt="map" class="map" />
<map name="Msj_Map" id="Msj_Map">
<area id="8" shape="poly" coords="436,141,486,141,486,207,436,206" />
<area id="1" shape="poly" coords="163,148,163,170,159,170" />
<area id="2" shape="poly" coords="163,207,153,207,159,173,163,173" />
<area id="189" shape="poly" coords="198,281,199,307,161,307,161,282" />
<area id="190" shape="poly" coords="198,309,199,333,161,334,161,309" />
<area id="165" shape="poly" coords="540,230,570,230,577,236,577,271,540,271" />
<area id="40" shape="poly" coords="384,1156,419,1156,419,1180,383,1180" />
<area id="39" shape="poly" coords="422,1156,458,1156,458,1180,422,1181" />
<area id="54" shape="poly" coords="321,1109,353,1109,359,1116,360,1159,321,1159" />
<area id="29" shape="poly" coords="356,1235,387,1235,387,1274,356,1274" />
<area id="22" shape="poly" coords="390,1277,457,1277,457,1311,453,1315,390,1315" />
<area id="23" shape="poly" coords="321,1277,387,1277,387,1315,321,1315" />
<area id="24" shape="poly" coords="319,1277,319,1316,252,1316,252,1277" />
</map>
我也試過:
<area id="1" shape="poly" coords="604,140,657,140,677,160,677,234,605,234" style="background-color:#00FFEE;" />
但不行... :(
請張貼的HTML標記和 – 2012-03-22 20:31:31
確定在這裏生成的標記的PHP我張貼 – 2012-03-22 20:32:28
爲了驗證HTML,標識以字母,az或AZ開頭。 – 2012-03-22 20:35:48