<div class="bg">背景颜色</div> css: .bg{ background-color: red; }
鼠标移动到元素改变背景颜色:
css: .bg:hover{ background-color: #003E82; }
用js改变背景颜色
document.getElementsByClassName('bg').style.backgroundColor="#b5b5b5";
转载联系作者并注明出处:https://www.focusonseo.cn/cassas/36.html