다음과 같은 내용이 있습니다. html
. 내 css
파일링크 속성 변경 중
<ol class="otherstufflinks">
<li>
<a href="./pythonNotes/index.html">Python notes</a>
</li>
<li>
<a href="./figure.html">Cool figure made using</a>
<a href="http://mbostock.github.com/d3/" class="nestedlink">d3.js library.</a>
</li>
</ol>
관련 부분은 다음과 같습니다
나는 다른 색상을 선택합니다a:link, a:visited {
color: steelblue;
text-decoration: none;
}
a:hover {
color: rgb(210,135,60);
}
.otherstufflinks > li,
.otherstufflinks a:link, .otherstufflinks a:visited
{
font-weight: normal;
color: rgb(75,75,75);
}
.otherstufflinks a:hover {
color: rgb(210,135,60)
}
는, 클래스 nestedlink
와 링크, 빨간색 말한다. 누군가가 나에게 그걸하는 법을 말해 줄 수 있다면 고맙겠습니다. 나는 다음을 시도했다. 그러나 그들 중의 누구도 일하지 않는다.
첫 번째 시도 :
.nestedlink a:link, .nestedlink a:visited {
color: red;
}
두 번째 시도 : 내가 잘못 가고 어디
.otherstufflinks .nestedlink a:link, .otherstufflinks .nestedlink a:visited {
color: red;
}
표시되지 않습니다. 당신의 도움을 주셔서 감사합니다.
Jake와 Kasapo에게 감사드립니다. 그렇다면'.otherstufflinks a : link'의 경우 왜 작동합니까? BTW 당신의 대답은 훌륭했습니다. 감사. 그래서 받아 들일 수 있기 전에 7 분을 기다려야한다고 말했습니다. – Curious2learn
.otherstufflinks a : 링크는 앵커가 'otherstufflinks'클래스를 가진 부모 요소 내에 상주한다는 것을 의미합니다. 귀하의 예제에서는 클래스를 중첩 링크로 설정합니다. –
"a : link"는 "otherstufflinks"클래스가있는 div의 자손이므로이 작동합니다. 그러나이 경우 a.nestedLink : link는 동일합니다. – Kasapo