2012-08-28 5 views
0

아래에이 CSS가 있습니다. 어떻게 링크를 클릭하면 다른 CSS에서 작성한이 CSS의 클릭 링크가 어떻게 작동하는지 알 수 있습니다. 링크 색상을 빨간색으로 바꿉니다. 나는 아래 코드에서 흰색을 유지하려했지만 도움이되지는 않았다. 나는 그것이 흰색 색상다른 CSS에서 CSS를 덮어 씁니다.

.grey { 
    background-color:#545154; 
    -moz-border-radius:6px; 
    -webkit-border-radius:6px; 
    border-radius:6px; 
    border:1px solid #120c12; 
    display:inline-block; 
    color:#ffffff; 
    font-family:arial; 
    font-size:15px; 
    font-weight:bold; 
    padding:6px 24px; 
    text-decoration:none; 
}.grey:hover { 
    background-color:#a8a5a8; 
}.grey:active { 
    position:relative; 
    top:1px; 
} 

.grey a:visited{ 
    color:white !important; 
    } 
.grey a:link{ 
    color:white !important;; 
    } 

HTML을

<a href="www.site.com" class="grey" style="color:white;">Site</a> 
+2

'class = "gray"'로 변경 하시겠습니까? – Shmiddty

+0

@Shmiddty가 말하는 것) –

+0

먼저 브라우저의 개발자 도구를 사용하여 CSS 규칙에 따라 링크가 빨간색으로 변하는 지 확인하십시오. 그런 다음 여기에 게시하십시오. – Jon

답변

1

선택기 작업 얻을 위해 무엇을 할 수 있는지 꺼져 있습니다. .grey:visited 또는 a.grey:visited이어야합니다.

관련 문제