css中的expression
为什么不试试css中的expression。在公用的css样式表文件中,加入下面的样式,即可立刻实现对所有li标签的效果——
<!DOCTYPE html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Keywords" content="YES!B/S!,web标准,杨正祎,博客园,实例代码" />
<meta name="Description" content="这是一个简单YES!B/S!文章示例页面,来自杨正祎的博客,http://justinyoung.cnblogs.com/" />
<title>YES!B/S!文章示例页面</title>
<style type="text/css">
/*** 为了便于演示,故将样式放在前台页面上 ***/
li{
star : expression(onmouseover=function() {this.style.backgroundColor="pink"}, onmouseout=function(){this.style.backgroundColor="";})
}
</style>
</head>
<body>
<ul >
<li>我是一个列表项,来自http://justinyoung.cnblogs.com/</li>
<li>我是一个列表项,来自http://justinyoung.cnblogs.com/</li>
<li>我是一个列表项,来自http://justinyoung.cnblogs.com/</li>
<li>我是一个列表项,来自http://justinyoung.cnblogs.com/</li>
<li>我是一个列表项,来自http://justinyoung.cnblogs.com/</li>
</ul>
</body>
</html>
li{
star : expression(onmouseover=function() {this.style.backgroundColor="pink"}, onmouseout=function(){this.style.backgroundColor="";})
}
td{
star : expression(onmouseover=function() {this.style.backgroundColor="pink"}, onmouseout=function(){this.style.backgroundColor="";})
}
blockquote{
star : expression(onmouseover=function() {this.style.backgroundColor="pink"}, onmouseout=function(){this.style.backgroundColor="";})
}
a{
star : expression(onmouseover=function() {this.style.backgroundColor="pink"}, onmouseout=function(){this.style.backgroundColor="";})
}