HTML/CSS: Text side overlay on images

I was looking for an HTML zoom effect when I instead came across this overlay effect on the W3School tutorial pages. Both examples will need an “img class” container in the code. The first example contains a URL embedded picture which was pasted into the code after obtaining the online address of the image.

Screen Shot of Copy Image Address of an online image
Screen Shot of Copy Image Address of an online image

This is done by right-clicking on an online image and select ‘Copy Image Address’. Make sure the URL address copied ends with .jpg.

The second example is one of my images from my blog Media Library, which was added using the Add Media button in the blog editor.

See HTML code outlined below.

Text Slide via a Left Overlay

Hover the mouse over the picture to see the HTML effect.

Game of Thrones 2017 poster

Hello World


picture of coffee bean I use in my coffee

Hello Coffee
/*text overlay effect
<div class="container">
<img class="image" src="https:image here" />
<div class="overlay">
<div class="text">Add your overlay text here</div>

/*text hover overlay
.container:hover .overlay {
width: 100%;

.text {
white-space: nowrap;
color: white;
font-size: 20px;
position: absolute;
overflow: hidden;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);



Game of Thrones (2017) poster of Sansa Stark. (2017). [image] Available at: [Accessed 29 Aug. 2017]. (n.d.). How To Create Image Hover Overlay Effects. [online] Available at: [Accessed 29 Jul. 2017].

Leave a Comment

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s