hover not working properly with opacity

user1012181

HTML

        <div class="col-md-3">
            <img src="img/thumnail1.jpg" class="thumbnail">
            <div class="thumbnail-area fa fa-search-plus"></div>
        </div>

CSS

.thumbnail:hover{
    background-color: #6bb533;
    border: 1px solid #6bb533;
}
.thumbnail:hover .thumbnail-area{
    opacity:1;
}
.thumbnail-area{
    background: #6bb533;
    position: absolute;
    display: inline-block;
    padding: 10px;
    bottom: 20px;
    right: -1px;
    font-size: 21px;
    color: #fff;
    opacity:0;
}

I need to make the opacity of .thumbnail-area to be 1 when hovering the .thumbnail. But it seems not working. Please help me.

Mr. Alien

Your .thumbnail-area is not nested under .thumbnail, it's adjacent to that, so you will need

.thumbnail:hover + .thumbnail-area{
    opacity:1;
}

Demo

Demo 2 (Just bounded the absolute positioned element using position: relative; container)

Demo 3 (Added an image for a real preview)


Also, if you see in the last demo, i.e Demo 3, opacity isn't comfortable, you can use display: none; and on :hover make it display: block; as anyways you are not fading the element, or transitioning, so you won't need opacity

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Opacity transition for a:hover not working

From Dev

:not(:hover) not working with opacity

From Dev

Opacity on hover not working in Chrome or IE

From Dev

CSS: hover not working due to opacity

From Dev

:hover and :hover:before not working properly

From Dev

slider with opacity and z-index not working properly

From Dev

CSS Gradient (hover) not working properly

From Dev

jQuery hover over not working properly

From Dev

Transition on :hover:before not working properly

From Dev

Why is my Hover Function not working Properly?

From Dev

Why is my Hover Function not working Properly?

From Dev

Font Awesome hover of stacked icons not working properly

From Dev

jquery hover class change not working properly

From Dev

Hover effect not working properly on each element after first time hover

From Dev

Opacity Off on a:hover and a:visited

From Dev

Apply opacity to img on hover

From Dev

Change opacity on hover

From Dev

Opacity Off on a:hover and a:visited

From Dev

Toggle a hover opacity

From Dev

Apply opacity to img on hover

From Dev

Opacity transition without hover

From Dev

jQuery hover Opacity and Click Stay on Opacity

From Java

Why is hover on my d3 map not working properly?

From Dev

nvd3 Interactive Guideline hover not working properly

From Dev

element hover not working properly in css3 fade effects

From Dev

CSS3 Animation on Link Hover not working properly

From Dev

Hover-over of Twitter bootstrap button not working properly

From Dev

text flickers on changing opacity on hover

From Dev

How to change highcharts opacity on hover?