2010-07-09 61 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