Image hover effects - how to change background on mouse over

| Drupal Website Development | 67 seen

Today I faced again some interesting thing to create - on hover image to change the background and display text over it

Here is how it looks:

On the left side, you can see the default image, while on the right side with mouse over. To achieve such behavior in Drupal is pretty simple, a little bit CSS and you are done.

Here is my view with div tags and Drupal fields:

<div class="image-hover">
[field_images]
<span class="image-overlay ">Read Full Article</span>
</div>

And here is CSS:

.image-hover {
display: inline-block;
position: relative;
background: #000;
line-height: 0px;
}

#image-hover:hover img {
opacity:0.3;
filter:alpha(opacity=30);

}
.image-hover span.image-overlay {
display: table-cell;
position: absolute;
z-index: 3;
background: transparent;
width: 100%;
top: 50%;
left: 0px;
color: transparent;
text-align: center;
vertical-align: center;
margin-top: -23px;
line-height: 20px;
}
.image-hover:hover span.image-overlay {
color:#fff;
text-shadow: 0px 0px 1px black;
}

Easy, right? 

 

Receive weekly trade ideas and portfolio adjustments directly to your inbox.

I share ongoing portfolio progress with a focus on generating income through covered calls on quality stocks. Each update includes positioning changes, trade rationale, and forward-looking adjustments based on current market conditions.

Latest articles

RWA Tokenization in Georgia: Key Takeaways from DGFI & Forbes Conference in Tbilisi

On April 24, 2026, DGFI, in collaboration with Forbes Georgia, hosted a conference on Real-World Asset (RWA) tokenization at the Radisson Blu Iveria Hotel in Tbilisi. The event brought together representatives from financial institutions, regulators, brokerage houses, and emerging fintech players to discuss the evolving landscape of tokenized…

Living in Georgia |

Building a Frame House in Latvia: Kitchen Installation, Ground Tilling & IKEA Trip

As usual, we planned our spring around the school break at BIST (British International School of Tbilisi). This year we again split the time — one week in Latvia working on the frame house in the west, and the other in Berlin for business meetings related to the translation company.Returning after winter always comes with surprises. This year didn…

Frame house - Capšu Zeme |