:visited
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2015ë 7ì.
:visited CSS ìì¬ í´ëì¤ë ì¬ì©ìê° ë°©ë¬¸í ì ì´ ìë ë§í¬ë¥¼ ëíë
ëë¤. :visitedê° ë°ê¿ ì ìë ì¤íì¼ì ê°ì¸ì ë³´ ë³´í¸ë¥¼ ìí´ ë§¤ì° ì íì ì
ëë¤.
/* 방문í ì ì´ ìë <a> ì í */
a:visited {
color: green;
}
:visited ìì¬ í´ëì¤ë¡ ì ìí ì¤íì¼ì ìì ë³´ë¤ ë¤ì ìì¹íê³ ëë±í ëª
ìì±ì ê°ì§ ë¤ë¥¸ ë§í¬ ìì¬ í´ëì¤(:link, :hover, :active)ê° ë®ì´ìëë¤. ë§í¬ë¥¼ ì ì í ëìì¸íë ¤ë©´ LVHA-ìì(:link â :visited â :hover â :active)를 ë°ë¼, :visited ê·ì¹ì :link ë¤, :hoverì :active ìì ë°°ì¹íì¸ì.
ì¤íì¼ ì í
ë¸ë¼ì°ì ë ê°ì¸ì ë³´ ë³´í¸ë¥¼ ìí´ :visitedìì ì¬ì©í ì ìë ì¤íì¼ì ì격í ì ííê³ ììµëë¤.
- ì¬ì© ê°ë¥í CSS ìì±ì
color,background-color,border-color,border-bottom-color,border-left-color,border-right-color,border-top-color,column-rule-color,outline-colorì ëë¤. - ì¬ì© ê°ë¥í SVG ìì±ì
fillê³¼strokeì ëë¤. - íì© ê°ë¥í ìì±ì ìí ì±ë ê°ì 무ìíê³ , ëì
:visitedê° ìë ëì ìí ì±ëì ì¬ì©í©ëë¤. ë¨, ê·¸ ê°ì´ 0ì¼ ë:visitedì ì¤íì¼ì 모ë 무ìí©ëë¤. - ì¬ì©ì ì
ì¥ììë 방문í ë§í¬ì ìì´ ë°ë ê²ì²ë¼ ë³´ì¼ ëë,
window.getComputedStyle()ë©ìëë ê±°ì§ì¼ë¡ë¼ë íì:visitedê° ìë ëì ì¤íì¼ì ë°íí©ëë¤.
ì°¸ê³ : ì¤íì¼ ì íì ê´í ë ë§ì ì ë³´ì ì´ì ì ëí´ìë ê°ì¸ì ë³´ì :visited ì íì 문ì를 ì°¸ê³ íì¸ì.
구문
Error: could not find syntax for this itemìì
기본ì ì¼ë¡ ìì´ ìê±°ë í¬ëª
í ìì±ì :visitedë¡ ìì í ì ììµëë¤. :visitedê° ìì ê°ë¥í ìì± ì¤ ë¸ë¼ì°ì ê° ê¸°ë³¸ê°ì ì§ì íëê±´ ë³´íµ colorì column-rule-color ë¿ì
ëë¤. ë°ë¼ì ë¤ë¥¸ ìì±ì ìì íê³ ì¶ë¤ë©´ 기본ê°ì ì§ì ì§ì í´ì¼ í©ëë¤.
HTML
<a href="#test-visited-link">ë§í¬ë¥¼ ìì§ ë°©ë¬¸íì§ ìì¼ì
¨ëì?</a><br />
<a href="">ì´ë¯¸ 방문íìµëë¤.</a>
CSS
a {
/* í¹ì ìì±ì í¬ëª
íì§ ìì 기본ê°ì ì§ì í´
:visited ìíë¡ ë°ê¿ ì ìëë¡ ì¤ì */
background-color: white;
border: 1px solid white;
}
a:visited {
background-color: yellow;
border-color: hotpink;
color: hotpink;
}
ê²°ê³¼
ëª ì¸
| Specification |
|---|
| HTML > # selector-visited > |
| Selectors Level 4 > # visited-pseudo > |
ë¸ë¼ì°ì í¸íì±
ê°ì´ 보기
- ê°ì¸ì ë³´ì :visited ì íì
- ë§í¬ ê´ë ¨ ìì¬ í´ëì¤:
:link,:active,:hover