본문 바로가기
IT 정보기술, 전자, 통신/HTML_CSS

Set the color for unvisited links to "red", and the color for visited links "blue".

by 팁텍북 2017. 9. 28.

Set the color for unvisited links to "red", and the color for visited links "blue".

Hint: The four links states are: a:link, a:visited, a:hover, a:active


예제 출처: w3스쿨


<!DOCTYPE html>

<html>

<head>

<style>

/* mouse over link */

a:hover {

    color: black;

}


/* selected link */

a:active {

    color: green;

}

/* unvisited link */

a:link {

    color: red;

}

/* visited link */

a:visited {

    color: blue;

}



</style>

</head>

<body>


<h1>This is a Heading</h1>

<p>This is a paragraph.</p>

<p><a href="https://www.w3schools.com">W3Schools.com</a></p>


</body>

</html>



댓글