CSS로 링크의 스타일을 지정하려면 먼저 링크, 방문, 호버 및 활성과 같은 링크 상태를 알아야 합니다. 앵커 요소의 유사 클래스를 사용하여 링크 스타일 지정 -
a:link for link a:visited forvisited link a:link for hover on link a:active for active link
예시
이제 예를 살펴보겠습니다 -
<!DOCTYPE html>
<html>
<head>
<style>
a:link {
color: orange;
text-decoration: underline;
}
a:hover {
color: red;
text-decoration: underline;
}
a:active {
color: green;
text-decoration: underline;
}
</style>
</head>
<body>
<h1>Tutorials</h1>
<p><a href="https://www.tutorialspoint.com/java">Java</a></p>
<p><a href="https://www.tutorialspoint.com/chsharp">C#</a></p>
<p><a href="https://www.tutorialspoint.com/jquery">jQuery</a></p>
<p><a href="https://www.tutorialspoint.com/ruby">Ruby</a></p>
<p><a href="https://www.tutorialspoint.com/pytorch">PyTorch</a></p>
</body>
</html> 출력

예시
이제 다른 예를 살펴보겠습니다 -
<!DOCTYPE html>
<html>
<head>
<style>
a:link {
color: blue;
text-decoration: none;
}
a:hover {
color: blue;
text-decoration: none;
}
a:active {
color: blue;
text-decoration: none;
}
</style>
</head>
<body>
<h1>Demo Heading</h1>
<div>
<p>This is the <a href="https://tutorialspoint.com">reference</a></p>
</div>
</body>
</html> 출력
