You can add an expression in CSS: expression.

Source: Internet
Author: User
Tags tagname

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 ......


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.