JavaWeb——CSS伪类

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>伪类</title>
	<style>
		a:link {
			color: blue;
			text-decoration: none;	/*取消下划线*/
		}
		a:visited {
			color: black;
		}
		a:hover {
			color: lightcoral;
		}
		a:active {
			color: lightgreen;
		}
		
	</style>
</head>
<body>
	<a href="http:\\www.sdfsdngwl.com">JavaWeb入门</a>
	<a href="http://www.baidu.com">44</a>
</body>
</html>

总结:伪类是a标签的改变样式的方法,有link、visited、hover、active。
link:未访问时候的样式
visited:访问后的样式
hover:鼠标停留在标签时候的样式
active:鼠标点击后的样式

注意:伪类的抒写是有顺序的!也是就link、visited、hover、active。

相关文章:

  • 2021-06-30
  • 2021-06-05
  • 2021-12-12
  • 2021-11-22
  • 2021-05-17
  • 2021-11-07
  • 2021-07-22
  • 2021-07-30
猜你喜欢
  • 2021-12-21
  • 2021-12-12
  • 2022-12-23
  • 2021-08-03
相关资源
相似解决方案