字体图标的使用,伪元素的使用

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>字体图标的使用、伪元素content的使用</title>
		<style>
			.myFont{
				font-family: iconfont;
			}
			/* 伪元素before content可以放置内容:笑脸,导出 */
			.smile::before{
				content:"\e641";
				color: red;
				font-size: 50px;
			}
			.output::before{
				content:"\e640";
				color: blue;
				font-size: 40px;
			}
		</style>
	</head>
	<body>
		<span class="myFont">@#xe641;</span>
		<!-- 伪元素smile的使用 -->
		<span class="myFont smile"></span>
		<span class="myFont output"></span>
	</body>
</html>

猜你喜欢

转载自blog.csdn.net/xqiitan/article/details/88423580