【问题标题】:CSS: How to change class style if another style is hoverCSS:如果另一种样式悬停,如何更改类样式
【发布时间】:2014-03-07 14:26:40
【问题描述】:

我有这个 css 代码:

.index-menu {
  float: right;
  width: 100px;
  height: 100px;
}
.index-menu .text-block {
  height: 50px;
  border: 1px solid #d1d300;
  background-color: #ffffff;
  color: #666;
}
.index-menu:hover .text-block {
  color: #000000;
}

如何让这段代码在 IE10-11 和 Mozilla 中运行?在 Chrome 中,此代码完美运行。

【问题讨论】:

  • HTML 代码在哪里?我们要考什么?
  • 如果您可以提供问题的工作示例,例如在 JSFiddle.net 中,那将是理想的。
  • 他们所说的。记录一下,这个 CSS 没问题,所以问题肯定出在 HTML 上。

标签: html css internet-explorer mozilla


【解决方案1】:

在 IE10,11 :active 中,:hover 伪类不会由子级触发。 IE支持页面的解决方案(由JS):https://connect.microsoft.com/IE/feedback/details/757765/ie10-active-psuedo-class-should-be-triggered-by-child-elements-too

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-08
    • 2022-06-16
    • 2017-12-30
    • 2017-04-03
    • 1970-01-01
    • 2017-09-30
    • 1970-01-01
    • 2013-04-28
    相关资源
    最近更新 更多