当前位置:   article > 正文

::before和::after伪元素以及content属性的使用_less样式怎么使用::after给元素加内容content: var

less样式怎么使用::after给元素加内容content: var

::before和::after伪元素加content属性可以用来做很多特殊的效果
在这里插入图片描述

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<style>
		.breadcrumb {
		  font-size: 1.6rem;
		  color: #333;
		}
		.breadcrumb a:first-child {
		  color: #82fcfd;
		}
		.breadcrumb a:first-child::before {
		  content: " » ";
		}
		.breadcrumb a::after {
		  content: " /";
		  color: #ef6eae;
		}
		.breadcrumb a:last-child::after {
		  content: "";
		}
	</style>
	<body>
		<div class="breadcrumb">
		  <a>程序员</a>
		  <a>前端</a>
		  <a>教程</a>
		</div>
	</body>
</html>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/木道寻08/article/detail/845873
推荐阅读
  

闽ICP备14008679号