关于CSS的按钮事件的问题!

html-css057

关于CSS的按钮事件的问题!,第1张

.btn{

  font-size:16px

  background-color:#ccc

  color:#000

  border:none

  padding:5px 10px

}

.me{

  background-color:#F6C

  color:#ffffff

}

<td id="mytd"></td>

<script type="text/javascript">

var tddom= document.getElementById('mytd')

var timer = null

tddom.onmousedown = function(){

timer = setTimeout( doStuff, 2000 )//这里设置时间

}

tddom.onmouseup = function(){

clearTimeout( timer )

}

function doStuff() {

alert('hello, you just pressed the td for two seconds.')

}

</script>

a:active { background:#f00 url(bg.jpg) no-repeat left centercolor:#ffftext-decoration:none }

当按下的时候显示背景、白色字、无下划线

鼠标滑过是 a:hover

已经访问过的链接是 a:visited

这些是链接的状态,很简单。