日期:2014-05-18  浏览次数:20598 次

请教:点击页面的一行要高亮显示,不使用JavaScript能做否?
点击页面上列表的一行(<tr>)的任何地方,该行要高亮显示,如果不使用JavaScript有没有办法?
完全通过css能否实现?
或者请求servlet在后台的办法能否实现?jsp中的这行(<tr>)要用什么方式才能访问到servlet?(不用链接方式,因为那样只能点击链接才可以高亮显示)
<tr>
  <td><input type="checkbox"></td>
  <td>name</td>
  <td>age</td>
  <td>sex</td>
</tr>


------解决方案--------------------
完全不用js, 不会了!
至少一个 if 以及一个变量 var 还是需要的。
------解决方案--------------------
完全CSS能实现,你看下下面的code就会明白了

<style>
a.demo{background:#F0EBD6;padding:8px;width:240px;text-decoration:none;color:#000000;}
a.demo:hover{background:#FFC080;color:#000000;}
a.demo:active{background:#CCCFFF;color:#000000;}
a.demo:visited{background:#FF3300;color:#000000;}
#idCodeDiv{width:100%;padding:4px;font-family:verdana,tahoma;margin:12px 0px 0px 0px;background-color:#EEEEEE;font-weight:bold;}
</style>


<a class=demo href="none.html" onclick="return false;">With a hush upon the marsh , the afternoon slid . Into the late, immobile period, The sun glazing the reeds and coating the limestone quarry as I, in repose With the marsh, bathed in solitude and splendor.</a>