<!DOCTYPE html> <html> <head> <meta charset= " utf-8" > <meta name= "author" content= "http://www.maomao365.com/" /> <title>CSS 实现鼠标放在上面时整行变色效果</title> <style type= "text/css" > div{ overflow : hidden ; white-space : nowrap ; height : 30px ; width : 250px ; background-color : white ; color : black ; } .divTest:hover{ background-color : blue ; color : white ; } </style> </head> <body> <div class= "divTest" >鼠标移上时,背景色发生变化</div> </body> </html> |
QQ群:513185891