您可以根据父对象的悬停更改伪元素:
#button:before { background-color: blue; content: ""; display: block; height: 25px; width: 25px;}#button:hover:before { background-color: red;}#button { display: block; height: 25px; margin: 0 10px; padding: 10px; text-indent: 20px; width: 12%;}#button:before { background-color: blue; content: ""; display: block; height: 25px; width: 25px;}#button:hover:before { background-color: red;}<div id="button">Button</div>


