PDA

View Full Version : Muốn thay đổi màu nền của TD khi click chuột vào?



www.quydo.com
12-06-2009, 22:47
Em muốn thay đổi màu nền của ô khi click chuột vào ô đó
Em có xem code trên trang này nhưng khi text bằng dreamweaver nó kô ok chút nào

doan code nhu sau:
<table
border="1" bordercolor="#800000" cellpadding="3" cellspacing="3"
width="200" align="center"><tr><td align="left"
bgcolor="#0000FF" <b style="color:black;background-color:#ffff66">onmouseover</b>="this.style.backgroundColor='#FF0000'"
onmouseout="this.style.backgroundColor='#0000FF'"> <a
href="http://www.it2know.net"> <span
style="font-family:verdana;font-size:85%;color:#ffffff;"><b>
HomePage </b></span></a> </td></tr>
<tr><td align="left" bgcolor="#483d8b"
<b style="color:black;background-color:#ffff66">onmouseover</b>="this.style.backgroundColor='#8a2be2'"
onmouseout="this.style.backgroundColor='#483d8b'"> <a
href="http://www.it2know.net/"> <span
style="font-family:verdana;font-size:85%;color:#ffffff;"><b>
www.it2know.net</b></span></a> </td></tr>
</td></tr>
</table>


Nguon
http://74.125.155.132/search?q=cache:bopIS4Ja-zwJ:khonggian-it.com/LapTrinh/View.php%3FidTin%3D274+%22onmouseover&cd=2&hl=vi&ct=clnk&gl=vn

NguoiVietNET88
13-06-2009, 10:09
Viết code lăng nhăn quá, thế này sao làm lớn được.
Bạn xem thử :
<style type="text/css">
td {background-color:#003399;}
td:hover{background-color:#00FF66;}
td:active{background-color:#FF0000;}
</style>