css,响应鼠标事件,文字变色
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>hover</title> </head> <body> <style type="text/css"> .s1{ /*background-color: gold;*/ font-size:0; } .s1 span{ width:98px; height: 30px; border:1px solid black; display:inline-block; padding: 0; font-size:16px; margin-left:-1px; text-align: center; line-height: 30px; } .s1 span:hover{ background-color: gold; } </style> <div class="s1"> <span>标题</span> <span>标题</span> <span>标题</span> <span>标题</span> </div> </body> </html>