<head>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
<style>
.category::before{
content: "◼";
margin-right: 0.5em;
}
</style>
</head>
<body>
<div class="category" style="color:red;">Category One</div>
</body>
</html>
Plunkr链接:https://plnkr.co/edit/FUzEmrbN23ow6gyMAHCf?p=preview 内容属性在浏览器中的表现不一致。