"CSS :link :visited :hover :active 셀렉터"의 두 판 사이의 차이

잔글 (로봇: 자동으로 텍스트 교체 (-http://jmnote.com/css/ +http://zetawiki.com/ex/css/))
19번째 줄: 19번째 줄:


==예시==
==예시==
*예제: http://jmnote.com/css/link-visited-hover-active.php
*예제: http://zetawiki.com/ex/css/link-visited-hover-active.php
<source lang='html5'>
<source lang='html5'>
<style>
<style>

2015년 7월 19일 (일) 16:29 판

1 개요

CSS :link :visited :hover :active Selector
CSS :link :visited :hover :active 셀렉터
:hover (마우스오버)와 :active (마우스누른상태)는 a 태그 외에도 적용가능

2 :link

  • 방문하지 않은 링크에 대한 셀렉터

3 :visited

  • 방문한 링크에 대한 셀렉터

4 :hover

  • 마우스가 올려져 있는 상태에 대한 셀렉터

5 :active

  • 누른 상태에 대한 셀렉터

6 예시

<style>
.my-class { font-size: 2em; }
.my-class:link { background-color: yellow; }
.my-class:hover { background-color: red; }
.my-class:visited { background-color: gray; }
.my-class:active { background-color: green; }
</style>

<br><a class='my-class' href='http://jmnote.com'>http://jmnote.com</a>
<br><a class='my-class' href='http://example.com'>http://example.com</a>
<br><a class='my-class' href='http://example.com/link1'>http://example.com/link1</a>
<br><a class='my-class' href='http://example.com/link2'>http://example.com/link2</a>

<p class='my-class'>안녕 p</p>
<div class='my-class'>안녕 div</div>

7 같이 보기

8 참고 자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}