Skip to content
Advertisement

Text between two images – The text comes to the front and the images are next to each other

I am trying to have the text between the two images come to the front and not separate the images.

The images should come together with a square-negative in-between and within this square the text should be, centered horizontally and vertically

I have tried position: relative, absolute. I have tried separating it into three divs etc. Not sure how to go about it. Thank you!

JavaScript
JavaScript

Advertisement

Answer

You can do it by giving the parent element position: relative and put the text into a container such as <span> or similar and give it this CSS:

JavaScript

Test:

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement