<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html" charset="UTF-8">
<link rel="stylesheet" type="text/css" href="Untitled2.css">
<title>Document</title>
</head>
<body>
<span>
香蕉
</span>
</body>
</html>
span:before{
content:"苹果";
}
span:after{
content:"\9650\91cf\62a2";
}
/*.box{
border:1px solid black;
}
.demo{
float:left;
width:100px;
height:100px;
background-color:black;
color:#fff;
}
p{
clear:both;
}*/
当content中为中文时会出现乱码,解决方法是利用转换工具,将中文转换成unicode编码的形式。转换工具的链接如下:
中文转unicode编码网址
查找限量抢的unicode编码是\u9650\u91cf\u62a2 ,注意一定要都去掉u才行。