【问题标题】:Adding 3 different buttons on to a semi-transparent area在半透明区域上添加 3 个不同的按钮
【发布时间】:2013-12-18 00:33:34
【问题描述】:

我需要帮助

  1. 如何在半透明区域 (<figcaption>) 内再添加两个图像按钮,并使所有 3 个按钮在半透明区域内垂直居中并均匀分布?

  2. 我添加的按钮似乎是半透明的(与<figcaption> 不透明度相同)。我需要按钮是opacity:1;

这是代码:

<div class="container demo-2">
<ul class="grid cs-style-2">
<li>
<figure>
<gt_descA>Chair</gt_descA>
<gt_descC>$87.34</gt_descC>
<img src="imagez/designs/thumbs/0/01.jpg" alt="img02">
<figcaption>
<a href="index.html" onClick=""><span class="hint  hint--top  hint--rounded" data-hint="Zoom Image"><img src="additional/buttons/bu_zoom.jpg"></img></span></a>
</figcaption>
</figure>
</li>
</ul>
</div>

CSS

.grid {
    padding: 70px 20px 100px 20px;
    max-width: 1300px;
    margin: 0 auto;
    list-style: none;
    text-align: center;
}

.grid li {
    display: inline-block;
    width: 234px;
    margin: 0;
    padding: 20px;
    text-align: left;
    position: relative;
}

.grid figure {
    margin: 0;
    position: relative;
}

.grid figure img {
    max-width: 100%;
    display: block;
    position: relative;
}

.grid figcaption {
    position: absolute;
    top: 0;
    left: 0;
    padding: 20px;
    background: #000;
    color: #ed4e6e;
    opacity:0;
}

/*button*/
.grid figcaption a {
    display: inline-block;
}

/* Caption Style*/
.cs-style-2 figure figcaption {
    z-index: 10;
    -webkit-transition: -webkit-transform 0.4s;
    -moz-transition: -moz-transform 0.4s;
    transition: transform 0.4s;
}

.no-touch .cs-style-2 figure:hover figcaption,
.cs-style-2 figure.cs-hover figcaption {
    -webkit-transform: translateY(0px);
    -moz-transform: translateY(0px);
    -ms-transform: translateY(0px);
    transform: translateY(0px);
    opacity:0.6;
}

.cs-style-2 figcaption {
    height: 24px;
    width: 187px;
    top: auto;
    bottom: 0px;
}

.cs-style-2 figcaption a {
    position: absolute;
    right: 20px;
    top: 30px;
}

@media screen and (max-width: 31.5em) {
    .grid {
        padding: 10px 10px 100px 10px;
    }
    .grid li {
        width: 100%;
        min-width: 234px;
    }
}

【问题讨论】:

    标签: html css opacity


    【解决方案1】:

    您可以添加按钮,并使用对齐它们

    container {
      text-align: center;
    }
    

    或者这个:

    container {
      max-width: someval;
      margin: 0 auto; // no vertical, auto horizontal
    }
    

    并且 alpha 过滤器(不透明度)也被添加到子元素中!也尝试为他们设定价值;分别..

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-19
      • 1970-01-01
      • 1970-01-01
      • 2011-09-15
      • 1970-01-01
      • 2018-02-05
      相关资源
      最近更新 更多