Add Greyscale effects on Avatar

Sameer Memon
Sameer Memon
2 Min Read
- Advertisement -

You have possibly seen this kind of effect on many websites, usually used while showcasing portfolios or clients.

In this effect, the whole image is shown in greyscale (black and white) normally, and when you hover over it, you see the actual colors of the image.

This effect can be useful if you have a retro-type forum or a dark theme style.

Take a look at the effect first:

greyscale effect on profile picture in xenforo
greyscale effect through CSS in xenforo

If you want this effect keep reading, if you don’t like this we have many such Xenforo Customization posts, I am sure you will find something you like.

- Advertisement -

Wondering how we removed the profile popup every time you hover on PP? read it here:

Let’s get back to the topic, to achieve the above effect we are going to use CSS.

Head over to your Xenforo Admin Panel > Appearance > Templates: and search for extra.less.

add the following code:

- Advertisement -
.avatar
{
    filter: grayscale(100%);
    transition: 1s;
}

.avatar:hover
{
    filter: grayscale(0%);
    transition: 1s;
}

Just like this:

adding greyscale effect to profile pictures in xenforo
greyscale effect CSS in xenforo

Click SAVE and done.

Please note that .avatar in the class for the profile pictures in xenforo default style, this code will work in the default style. But for custom style, you have to find the class of the Profile image. You can find this by right-click on the profile picture and inspect.

- Advertisement -
Follow:
Sameer Memon is a passionate writer with 3 years of experience in Blogging. With a strong background in Blogs, SEO, and Social Media Marketing, Sameer has been creating engaging content on various topics for a wide range of clients. As a dedicated and driven individual, Sameer takes pride in delivering well-researched and thoughtfully written articles that provide readers with valuable insights and information. He is constantly striving to stay up-to-date with the latest industry trends and techniques to produce content that is not only informative but also engaging and easy to read. When Sameer isn't busy writing, he enjoys gaming. He also loves to explore new places to gain fresh perspectives and inspiration for his writing. If you're interested in learning more about Sameer and his work, you can follow him on social media platform at give handles.