【问题标题】:hover on div in Ionic将鼠标悬停在 Ionic 中的 div 上
【发布时间】:2016-08-17 08:21:36
【问题描述】:

我正在用 ionic 创建一个应用程序,我在主页上有两张图片。背景图像上有一个灰色过滤器。我希望当用户选项卡将不透明度从 0.7 更改为 0.4 时悬停。但是代码 :hover 在 Css 中不起作用。这是我的代码sn-ps

        <a class="col-50 div2"  ui-sref="belege">
            <div class="opaq-bg"></div>
            <span>Belege</span>
        </a>

这里是css文件

#home  .div1{
    background-image: url(../img/checkliste.jpg);
    color: #fff;
    text-decoration: none;
}
#home  .div2{
    background-image: url(../img/belege.jpg);
    color: #fff;
    text-decoration: none;
}

.opaq-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(68, 68, 68, 0.7);
    z-index: 0;
}

.opaq-bg:hover {
    background-color: rgba(68, 68, 68, 0.4);
}

【问题讨论】:

    标签: css ionic-framework ionic-view


    【解决方案1】:

    我测试了您的代码并且它有效。当我将鼠标悬停在 div 上时,它的不透明度从 0.7 更改为 0.4。这就是你想要做的?

    仅测试您在问题中单独输入的代码以查看结果,然后尝试搜索其他代码是否可能与该代码发生冲突。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-08
      • 1970-01-01
      • 2021-11-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多