zoukankan      html  css  js  c++  java
  • CSS实现鼠标滑过表格变色

     简单的隔行变色:
    <style type="text/css"> 
    
    <!-- 
    
    tr {background-color:expression((this.sectionRowIndex%2==0)?"#E1F1F1":"#F0F0F0")} 
    
    --> 
    
    </style> 
    
    <table> 
    
    <tr><td>第1行</td><td>第1列</td></tr> 
    
    <tr><td>第2行</td><td>第2列</td></tr> 
    
    <tr><td>第3行</td><td>第3列</td></tr> 
    
    <tr><td>第4行</td><td>第4列</td></tr> 
    
    <tr><td>第5行</td><td>第5列</td></tr> 
    
    </table>
    
    -------------------------------
    
    每个单元格变色:
    
    <style type="text/css"> 
    
    <!-- 
    
    tr {background-color:expression((this.sectionRowIndex%2==0)?"red":"blue")} 
    
    td {background-color:expression((this.cellIndex%2==0)?"":((this.parentElement.sectionRowIndex%2==0)?"green":"yellow"))} 
    
    --> 
    
    </style> 
    
    <table> 
    
    <tr><td>第1行</td><td>第1列</td></tr> 
    
    <tr><td>第2行</td><td>第2列</td></tr> 
    
    <tr><td>第3行</td><td>第3列</td></tr> 
    
    <tr><td>第4行</td><td>第4列</td></tr> 
    
    <tr><td>第5行</td><td>第5列</td></tr> 
    
    </table>
    
  • 相关阅读:
    银行卡和手机号占位符
    防京东进度尺的金额
    圆的进度条
    HMTL5滑动块研究
    自动生成验证码
    HTML5语义化
    (转)C++中使用C代码
    (转)四旋翼飞行器基本知识
    如何将.jpg图片 转换成.eps 格式图片
    HDOJ 1196 Lowest Bit
  • 原文地址:https://www.cnblogs.com/findw/p/1768987.html
Copyright © 2011-2022 走看看