当光标放在特定区域上时,该区域颜色改变
代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
a:hover {
background-color: orange;
}
a {
background-color: gray;
display: block;
width: 230px;
height: 40px;
text-decoration: none;
color: aliceblue;
text-indent: 2em;
line-height: 40px;
}
</style>
</head>
<body>
<a href="#">手机 电话卡</a>
<a href="#">电视 盒子</a>
<a href="#">笔记本 平板</a>
<a href="#">出行 穿戴</a>
<a href="#">智能 路由器</a>
<a href="#">健康 儿童</a>
<a href="#">耳机 音响</a>
</table>
</body>