2012-07-05 5 views
2

클래스를 추가하려고하는 A 태그가 있습니다. 이것은 아마도 매우 간단한 것일 테지만 전에는 해보지 않았습니다.태그 클래스가 작동하지 않습니다.

<a class="button" href="landscaping.html">Find out more about our landscape design services</a> 

그리고 CSS :

a .button{ 
color:#7cc242; 
font-family: 'PTSansNarrowBold'; 
font-size:18px; 
margin-top: 7px; 
margin-bottom: 0px; 
text-align:right; 
text-decoration:none; 
display: inline-block; 
zoom:1; 
*display:inline; 
padding-right:30px; 
background:url(images/more-btn.png) no-repeat top right;} 

아무것도, 난 그냥 표준 푸른 받고 있어요 작동하는 것 같군. 누구든지 도와 줄 수 있습니까?

답변

8

공간이 있어서는 안됩니다. 변경 사항 :

a .button{ 

에 : 여기

a.button{ 

체크 아웃 바이올린 : 당신이 당신의 CSS에 뭐라고 http://jsfiddle.net/VhaNQ/

+2

정말 고마워요! D' oh - 그 바보 같은 문제 중 하나라는 것을 알았습니다. 블라인드하게 보이는 것을 볼 수있게 해줘서 고마워! 설명을 위해 – Francesca

4

모든 a, 나는 수업 button 모든 아이들을 원한다 "입니다 태그를 사용하여 다음 CSS 규칙을 사용하십시오 ".

당신이 말하고자하는 것은 "다음 CSS 규칙을 사용하려면 등급의 a 태그를 원합니다"입니다.

이는 다음 CSS를 작성하여 달성 :이 태그/클래스/ID 사이에 a.button

스페이스 사이에 공백 없다 "요소의 자식"을 의미

a.button{ 
    color:#7cc242; 
    font-family: 'PTSansNarrowBold'; 
    font-size:18px; 
    margin-top: 7px; 
    margin-bottom: 0px; 
    text-align:right; 
    text-decoration:none; 
    display: inline-block; 
    zoom:1; 
    *display:inline; 
    padding-right:30px; 
    background:url(images/more-btn.png) no-repeat top right; 
} 

있다.

행운을 빕니다 :)

+0

+1. 감사. – JerryOL

3

제거이 a.button 같은 a .button에서 공간 사용하거나 단순히 .button

관련 문제