css如何实现鼠标移入改变背景色

 时间:2024-10-12 11:07:47

1、在编辑器内新建一个stduy.html,用来学习今天的内容

css如何实现鼠标移入改变背景色

3、在style标签内给div加上样式

css如何实现鼠标移入改变背景色

5、在浏览器里打开stduy.html,发现鼠标移入div,背景色改变

css如何实现鼠标移入改变背景色

6、贴一下代码:<!DOCTYPE html><html> <head> <meta charset="utf-8"> <title>css如何实现鼠标移入改变背景色</title> </head> <style> .test{ width: 200px; height: 200px; background-color: black; } .test:hover{ background-color: red; } </style> <body> <div class="test"></div> </body></html>

  • HTML网页怎么设置圆角边框
  • 去掉小圆点;li标签去掉圆点
  • 怎么让两个div在同一行
  • css中如何实现button垂直居中
  • float居中怎么设置
  • 热门搜索
    怎么延长时间 照片分辨率怎么调 读后感怎么写 速效救心丸怎么吃 营业执照怎么办 家长的话怎么写 december怎么读 艾滋病怎么得的 大姨妈来了肚子疼怎么办 梅毒怎么治疗