幻灯片放映图像鼠标悬停下拉 CSS

slideshow image mouseover dropdown css

提问人:kkkonchip 提问时间:11/17/2023 更新时间:11/17/2023 访问量:17

问:

我制作了一个自动图像幻灯片。 我想在将鼠标悬停在幻灯片图像上时制作下拉图像。 我已经放置了下拉式 css、html 代码,但它不起作用。有什么解决方案吗?

CSS 代码 HTML 代码

我想在将鼠标悬停在幻灯片图像上时制作下拉图像。

HTML CSS 图像 下拉幻灯片

评论

0赞 Minal Chauhan 11/17/2023
请不要使用图像作为代码,请提供相关的代码块来向我们展示您尝试执行的操作。

答:

0赞 CodeGust 11/17/2023 #1

很可能是因为 css 中缺少 '' 属性。 这是您的代码简化,它工作正常:height

.dd {
  position: relative;
  display: inline-blick;
  width: 200px;
  height: 200px;
  background: green;
}

.dc {
  display: none;
  position: absolute;
  z-index: 1;
  width: 100px;
  height: 100px;
  background: silver;
}

.dd:hover .dc {
  display: block;
}
<div class='dd sl'>
  <div class='dc'>

  </div>
</div>

此外,最好不要在标记样式属性中编写样式,而是在 css 文件或块中编写样式。