悬停时<strong>和<h4>的问题

Nam*_*eo0 -1 html css hover

当我将鼠标悬停在表格中的h4标签上时,一切正常.但是,当我将鼠标悬停在位于h4元素内的强标记上时,强标记会获得与h4标记相同的悬停.

我有一个表元素,每个td元素的结构如下所示:

<td>
  <a>
    <div>
      <h4>
        ...<strong>...</strong>...
      </h4>
    </div>
  </a>
</td>
Run Code Online (Sandbox Code Playgroud)

这是影响表中元素的CSS.

h4 {
  font-weight: 100;
  margin: 0px;
  padding: 12px 0px;
  color: black;
}

a {
  text-decoration: none;
}

a:visited {
  color: white;
  background-color: none;
}

strong :hover {
  background: none !important;
  background-color: transparent !important;
}

/*Used for the gradient on hover for the background*/

.itemTrue > a > div :hover {
  color: white;
  background: #e4e4e4;
  background: -moz-linear-gradient(top,  #e4e4e4 0%, #295534 73%, #1d3923 88%, #000000 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#e4e4e4), color-stop(73%,#295534), color-stop(88%,#1d3923), color-stop(100%,#000000));
  background: -webkit-linear-gradient(top,  #e4e4e4 0%,#295534 73%,#1d3923 88%,#000000 100%);
  background: -o-linear-gradient(top,  #e4e4e4 0%,#295534 73%,#1d3923 88%,#000000 100%);
  background: -ms-linear-gradient(top,  #e4e4e4 0%,#295534 73%,#1d3923 88%,#000000 100%);
  background: linear-gradient(to bottom,  #e4e4e4 0%,#295534 73%,#1d3923 88%,#000000 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e4e4e4', endColorstr='#000000',GradientType=0 );
}
Run Code Online (Sandbox Code Playgroud)

我想要做的是基本上将悬挂强标签的背景保持为空白,同时仍然将渐变显示为悬停时div/h4的背景.

当没有任何东西被徘徊时,一切都很完美.

Seb*_*lia 11

您必须连接选择器strong:hoverCSS:

strong:hover
Run Code Online (Sandbox Code Playgroud)

在你的代码中

strong :hover
Run Code Online (Sandbox Code Playgroud)