Strong CSS
Html Code : <HTML> <br/> <pead> <br/> <meta http-equiv = "Content-Type" content = "text/html; charset = gb2312 "> <br/> <title> test table CSS </title> <br/> <style type =" text/CSS "> <br/> <! -- <Br/> # maid tr {<br/> background-color: expression (<br/> This. sectionrowindex = 0? "# Ffcccc": <br/> (this. sectionrowindex % 2 = 0 )? "# Fff0f0": "# f0f0ff" <br/>); <br/> color: expression (this. sectionrowindex = 0? "# Ffffff": ""); <br/> font-weight: expression (this. sectionrowindex = 0? "Bold": ""); <br/> tableselect: expression (<br/> This. sectionrowindex = 0? "": <Br/> (<br/> onmouseover = function () <br/>{< br/> This. style. backgroundcolor = <br/> (<br/> This. style. backgroundcolor! = "#69 cdff "? "#69 cdff": <br/> (<br/> This. sectionrowindex = 0? "# Ffcccc": <br/> (<br/> This. sectionrowindex % 2 = 0? "# Fff0f0": "# f0f0ff" <br/>) <br/>}, <br/> onmouseout = function () <br/>{< br/> This. style. backgroundcolor = <br/> (<br/> This. style. backgroundcolor! = "#69 cdff "? "#69 cdff": <br/> (<br/> This. sectionrowindex = 0? "# Ffcccc": <br/> (<br/> This. sectionrowindex % 2 = 0? "# Fff0f0": "# f0f0ff" <br/>) <br/> <br/>}< br/> <br/>) <br/>}< br/> # datagrid1 TD {<br/> background-color: expression (<br/> This. cellindex = 0? <Br/> (<br/> This. parentelement. sectionrowindex = 0? "# Ffcccc": "# dddddddd" <br/>) <br/>: NULL <br/>) <br/>}< br/>. findareatable {<br/> font-size: 12px; <br/> color: #333333; <br/> text-Decoration: none; <br/> width: 1024px; <br/> cursor: hand; <br/> background-color: # ffffff; <br/> vertical-align: middle; <br/> text-align: center; <br/>}< br/> --> <br/> </style> <br/> </pead> <br/> <body bgcolor = "# ffffff" leftmargin = "0" topmargin = "0"> <br/> <Table cellspacing = "1" class = "findareatable" id = "datagrid1"> <br/> <tr> <br/> <TD> table test </TD> <br /> <TD> table test </TD> <br/> </tr> <br/> <TD> table test </TD> <br /> <TD> table test </TD> <br/> <TD> test the table </TD> <br/> </tr> <br/> <TD> test the table </TD> <br /> <TD> table test </TD> <br/> <TD> table test </TD> <br/> </tr> <br/> <tr> <br /> <TD> table test </TD> <br/> <TD> table test </TD> <br/> </tr> <br/> <TD> table test </TD> <br/> <TD> table test </TD> <br/> <TD> test the table </TD> <br/> </tr> <br/> <TD> test the table </TD> <br/> <TD> table test </TD> <br/> <TD> test the table </TD> <br/> </tr> <br/> <tr> <br/> <TD> table test </TD> <br/> <TD> table test </TD> <br/> </tr> <br/> <TD> table test </TD> <br/> <TD> table test </TD> <br/> <TD> test the table </TD> <br/> </tr> <br/> <TD> test the table </TD> <br/> <TD> table test </TD> <br/> <TD> table test </TD> <br/> </tr> <br/> <tr> <br/> <TD> table test </TD> <br/> <TD> table test </TD> <br/> </ tr> <br/> <TD> table test </TD> <br/> <TD> table test </TD> <br/> <TD> table test </TD> <br/> </tr> <br/> <TD> table test </TD> <br/> <TD> table test </TD> <br/> <TD> table test </TD> <br/> <TD> table test </TD> <br/> </tr> <br/> <TD> table test </TD> <br/> <TD> table test </TD> <br/> <TD> table test </TD> <br/> </tr> <br/> <tr> <br/> <TD> table test </TD> <br/> <TD> table test </TD> <br/> <TD> table Test </TD> <br/> </tr> <br/> <TD> table test </TD> <br/> <TD> table test </TD> <br/> <TD> table Test </TD> <br/> <TD> table test </TD> <br/> </tr> <br/> </table> <br/> </body> <br/> </ptml> <br/>
[Ctrl + A select all tips: you can modify some code and then press run]
You can add an expression in CSS: expression.
<Style>
<! --
. TD {font-size: 9pt; Weaver: expression (highlight (this ))}
-->
</Style>
<Script language = "JavaScript">
<! --
Function highlight (OBJ ){
VaR hightlightbgcolor = '# d6d6d6 ';
OBJ. onmouseover = function (){
VaR o = event. srcelement;
If (O. tagname = "TD "){
With (O. parentelement ){
Style. backgroundcolor = hightlightbgcolor;
}
}
}
OBJ. onmouseout = function (){
VaR o = event. srcelement;
If (O. tagname = "TD") {o. parentelement. style. backgroundcolor = '';}
}
}
Function controlcontent01 (){
If (contentid01.style. Display = 'None '){
Contentid01.style. Display = '';
Imgarrow01.src = 'gray_up_arrow.gif ';
}
Else {
Contentid01.style. Display = 'none ';
Imgarrow01.src = 'gray_down_arrow.gif ';
}
}
// -->
</SCRIPT>
========================================================== ========================================================== =
<! Doctype HTML public "-// W3C // dtd html 4.0 transitional // en">
<HTML>
<Head>
<Title> use JavaScript (onmouseover/onmouseout) 2 in CSS styles </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
{
/* Set the onmouseover event */
Onmouseover: expression (onmouseover = function () {This. style. bordercolor = 'Blue '; this. style. color = 'red'; this. style. backgroundcolor = 'yellow '});
/* Set the onmouseout event */
Onmouseout: expression (onmouseout = function () {This. style. bordercolor = ''; this. style. Color =''; this. style. backgroundcolor = ''});
Background-color: # ffffff;
}
</Style>
</Head>
the wind blew out dandelion .. .... |
the wind blew out dandelion ...... |
the wind blew out dandelion ...... |
the wind blew out dandelion ...... |
the wind blew out dandelion ...... |
the wind blew out dandelion ...... |