Vannkorn

Full Stack Web Developer

Close

Reversing background image

This sounds easy, isn't it? Yes, indeed! The power of CSS can help achieve this in just a line of code.

Ads: Register now via this link to receive $100 credit from Vultr

This sounds easy, isn’t it?

Yes, indeed! The power of CSS can help achieve this in just a line of code.

I decided to make a post on this because for so long I’ve experienced duplicating the original image and then doing the Flip horizontal to have another reversed version of the media.

Just now, I realize that it was a big mistake since it will add stuff to the page load and consume more time.

As previously speaking, CSS provides just a short line of code to achieve this, which is:

transform: scaleX(-1)

This is helpful when you need to work in the Right to Left layout like in Arabic which you not only reverse the text, but also the background medias.

Leave a Reply

Your email address will not be published. Required fields are marked *