这将帮助你,如果JavaScript是明显的
<TD onMouseOver="this.bgColor='#00CC00'" onMouseOut="this.bgColor='#009900'" bgColor=#009900>
<A HREF="http://www.mysite.com">Click Here</A></TD>
或
的Javascript更改超链接文本颜色的onmouseover
<style type="text/css">
a {
font-weight:bold;
font-family:verdana;
text-decoration:none;
}
</style>
<script type="text/javascript" language="javascript">
function changeColor(idObj,colorObj)
{
document.getElementById(idObj.id).style.color = colorObj;
}
</script>
<a href="#" style="color: #000000" onmouseover="this.style.color='#FF0000'" onmouseout="this.style.color='#000000'">
Link 1</a>
<br />
<br />
<a href="#" style="color: #999999" onmouseover="this.style.color='#008000'" onmouseout="this.style.color='#999999'">
Link 2</a>
<br />
<br />
<a href="#" style="color: #FF0000" onmouseover="this.style.color='blue'" onmouseout="this.style.color='#FF0000'">
Link 3</a>
<br />
<br />
<a id="lnk1" href="#" style="color: #008000" onmouseover="changeColor(this,'#FF0000');"
onmouseout="changeColor(this,'#008000');">Link Color change using javascript function</a>
可以使用javascipt的做到这一点。 JavaScript是可观的? – Sujeet 2011-02-25 05:02:23
你不能。请参阅:http://stackoverflow.com/questions/1033156/how-to-write-ahover-in-inline-css – jterrace 2011-02-25 05:01:08
这是转发:http://stackoverflow.com/questions/1033156/how-to- write-ahover-in-line-css 悬崖笔记是':hover'是一个伪类,只能在样式表中使用。 您可以创建一个类并通过PHP进行分配,或者使用一些JS来执行onmouseover和onmouseout。 – Xenethyl 2011-02-25 05:01:16