2010-07-09 95 views
1
a.mO {color: white; cursor:pointer; margin-left:10px; font-weight:400; font-size:12px; display:block; border-top:1px solid #300;} 

a.mO:link { 
color: white; cursor:pointer; margin-left:10px; font-weight:400; font-size:12px; display:block; border-top:1px solid #300; 
} 
a.mO:visited { 
color: white; cursor:pointer; margin-left:10px; font-weight:600; font-size:16px; display:block; border-top:1px solid #300; 
} 

a.mO:hover { 
color: white; cursor:pointer; margin-left:10px; font-weight:900; font-size:12px; display:block; border-top:1px solid #300; 
} 

a.mO:active{ 
color: white; cursor:pointer; margin-left:10px; font-weight:900; font-size:14px; display:block; border-top:2px solid #300; 
} 

第一个代码工作。但只要我用第二个替换它就停止工作。链接样式方案不工作

我的HTML是:

<div><a class="mO" onclick="loadPage(31);">ABCD Status</a></div> 

感谢您的帮助......

+0

您能否再详述一下? – alex 2010-07-09 05:13:22

回答

1

有些不会工作,除非你包括href属性(它不是其它的链接方式):

<a class="mO" href="#" onclick="loadPage(31);">ABCD Status</a> 

调用该函数后,您可能还想要return false;,以防止页面跳转到顶部。您可以执行onclick="loadPage(31); return false;"onclick="return loadPage(31);",并使其返回false

+0

感谢您的其他信息.. – Anupam 2010-07-09 07:55:27

1

试着改变你的代码

<div><a class="mO" href="#" onclick="loadPage(31);">ABCD Status</a></div> 

,看看有没有什么帮助任何。

+0

谢谢你们。这有帮助! – Anupam 2010-07-09 07:54:33