CSS樣式裡使用JavaScript

來源:互聯網
上載者:User

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> CSS樣式裡使用JavaScript(onmouseover/onmouseout)2</TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">

<style type="text/css">
table
{

 background-color:#000000;
 cursor:hand;
}

td
{
  /*設定onmouseover事件*/
  onmouseover: expression(onmouseover=function (){this.style.borderColor

='blue';this.style.color='red';this.style.backgroundColor ='yellow'});

  /*設定onmouseout事件*/
  onmouseout: expression(onmouseout=function ()

{this.style.borderColor='';this.style.color='';this.style.backgroundColor

=''});
  background-color:#ffffff;
}
</style>
</HEAD>

<BODY>
<TABLE cellspacing='1px' border='1'>
<TR >
 <TD >1......    </TD>
 <TD>2......   </TD>
 <TD>3......   </TD>
</TR>
<TR >
 <TD >4......    </TD>
 <TD>5......   </TD>
 <TD>6......   </TD>
</TR>
</TABLE>
</BODY>
</HTML>

 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.