English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
:visited CSS pseudo-class represents the links that the user has visited.
Manual completo de seletores CSS
Select the style of visited links:
!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Tutorial básico(oldtoolbag.com)</title> <style> a:visited { background-color:lightgreen; } </style> </head> <body> <a href="//pt.oldtoolbag.com">oldtoolbag.com</a> <a href="//www.baidu.com" target="_blank">baidu.com</a> <a href="//www.pcjson.com" target="_top">pcjson.com</a> <p><b>Attention:</b> :visited selector styles links to the pages you have visited.</p> </body> </html>Teste e veja ‹/›
:visited adds special styles to visited links.
Tip: Use the :visited selector to set the style of visited page links, :hoverSeletor para o estilo do link quando há mouse sobre ele:active Definir o estilo ao clicar no link.
Os números na tabela indicam a primeira versão do navegador que suporta essa propriedade.
Seletor | |||||
---|---|---|---|---|---|
:visited | 4.0 | 7.0 | 2.0 | 3.1 | 9.6 |
Tutorial CSS: Links CSS
Tutorial CSS: Pseudo-classes CSS
Links ativos, visitados, não visitados ou quando há mouse sobre eles:
!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Tutorial básico(oldtoolbag.com)</title> <style> a:link {color:green;} a:visited {color:green;} a:hover {color:red;} a:active {color:yellow;} </style> </head> <body> <p>Coloque o mouse sobre e clique neste link: <a href="//pt.oldtoolbag.com/">oldtoolbag.com</a></p> </body> </html>Teste e veja ‹/›
Estilos de links com diferentes estilos:
!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Tutorial básico(oldtoolbag.com)</title> <style> a.ex1:hover,a.ex1:active {color:red;} a.ex2:hover,a.ex2:active {font-size:150%;} a.ex3:hover,a.ex3:active {background:red;} a.ex4:hover,a.ex4:active {font-family:monospace;} a.ex5:visited,a.ex5:link {text-decoration:none;} a.ex5:hover,a.ex5:active {text-decoration:underline;} </style> </head> <body> <p>Coloque o mouse sobre o link para ver a mudança de estilo.</p> <p><a class="ex1" href="/css/">Esta link muda a cor</a></p> <p><a class="ex2" href="/css/">Esta link muda o tamanho da fonte</a></p> <p><a class="ex3" href="/css/">Esta link muda a cor de fundo</a></p> <p><a class="ex4" href="/css/">Esta link muda o tipo da fonte</a></p> <p><a class="ex5" href="/css/">Esta link muda a formatação do texto</a></p> </body> </html>Teste e veja ‹/›