선택자 뒤에 :가상이벤트 를 붙이면 특정 이벤트에 따라 적용할 스타일을 선택할 수 있음
링크의 스타일 설정
방문된 링크의 스타일 설정
활성화된 (클릭) 링크의 스타일 설정
호버링된 (머무름) 링크의 스타일 설정
포커스된 (tab키, 클릭으로 포커스) 링크의 스타일 설정
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style>
a:link{
color:black;
}
a:visited{
color:red;
}
a:active{
color:green;
}
a:hover{
color:yellow;
}
a:focus{
color:white;
}
input:focus{
background-color: black;
color:white;
}
</style>
</head>
<body>
<a href="https://opentutorials.org">방문함</a>
<a href="https://a.a">방문안함</a>
<input type="text">
</body>
</html>