์ด๋ฒˆ์—๋Š” CSS๋ฅผ ์ด์šฉํ•œ ๋งํฌ ๊ด€๋ จ ์„ค์ •์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.  

 

  •  :link Signifies unvisited hyperlinks.

  •  :visited Signifies visited hyperlinks.

  •  :hover Signifies an element that currently has the user's mouse pointer hovering over it.

  •  :active Signifies an element on which the user is currently clicking.

์ด ๋งํฌ๊ด€๋ จ ์†์„ฑ์€ HTML๋ฌธ์„œ์˜ ํ—ค๋”๋ถ€๋ถ„์— ์ •์˜๋ฅผ ํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  a:hover์†์„ฑ์€ a:link ์™€ a:visited ๋‹ค์Œ์— ์™€์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  a:active์†์„ฑ์€ a:hover์†์„ฑ ๋‹ค์Œ์— ์™€์•ผ ํ•ฉ๋‹ˆ๋‹ค. 

<style type="text/css">
a:link {color: #000000}
a:visited {color: #006600}
a:hover {color: #FFCC00}
a:active {color: #FF00CC}
</style>

 

 

 

# ์ฐธ๊ณ ๋กœ ์•„๋ž˜ ์˜ˆ์ œ๋“ค์€ ๋„ค์ด๋ฒ„ ๋ธ”๋กœ๊ทธ ํŠน์„ฑ์ƒ ์Šคํƒ€์ผ์„ ๋จน์ง€ ์•Š๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๊ฐœ์ธ์ ์œผ๋กœ html๋ฌธ์„œ๋ฅผ ๋งŒ๋“ค์–ด์„œ ํ…Œ์ŠคํŠธ ํ•ด๋ณด์‹œ๊ธฐ๋ฅผ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

 

 

๋งํฌ ๊ธฐ๋ณธ ์ƒ‰์ƒ ์„ค์ •

Following is the example which demonstrates how to set the link color. Possible value could be any color name in any valid format.

<style type="text/css">
a:link {color:#0000FF}
</style>
<a href="/html/index.htm">Black Link</a>

This will produce following black link:

Black Link

 

๋ฐฉ๋ฌธํ–ˆ๋˜ ๋งํฌ ์ƒ‰์ƒ ์„ค์ •

Following is the example which demonstrates how to set the color of visited links. Possible value could be any color name in any valid format.

<style type="text/css">
a:visited {color: #006600}
</style>
<a href="/html/index.htm">Click this link</a>

This will produce following link. Once you will click this link, it will change its color to green.

Click this link

 

๋งˆ์šฐ์Šค hover์‹œ ๋งํฌ ์ƒ‰์ƒ ์„ค์ •

Following is the example which demonstrates how to change the color of links when we bring a mouse pointer over that link. Possible value could be any color name in any valid format.

<style type="text/css">
a:hover {color: #FFCC00}
</style>
<a href="/html/index.htm">Bring Mouse Here</a>

This will produce following link. Now you bring your mouse over this link and you will see that it changes its color to yellow.

Bring Mouse Here

 

์•กํ‹ฐ๋ธŒ ๋งํฌ ์ƒ‰์ƒ ์„ค์ •

Following is the example which demonstrates how to change the color of active links. Possible value could be any color name in any valid format.

<style type="text/css">
a:active {color: #FF00CC}
</style>
<a href="/html/index.htm">Click This Link</a>

This will produce following link. This will change it color to pink when user clicks it.

Click This Link

 

 

 

 

 

 

 

Reference : http://www.tutorialspoint.com/css/css_links.htm