选项卡悬停 CSS

tab hover with CSS

这三种情况,有没有办法写成CSS?

  1. 正常模式下

  2. 处于悬停模式

  3. 悬停

.tab:hover:nth-of-type(1) ~ .tab__content:nth-of-type(1) {
opacity: 1;
transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
transition: 0.5s opacity ease-in, 0.8s transform ease;
transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
position: relative;
top: 0;
z-index: 100;
-webkit-transform: translateY(0px);
transform: translateY(0px);
text-shadow: 0 0 0;
}

enter image description here

js

CSS 中只有 :hover 但在 Javascript 中你有 mouseovermouseout 是否有用?