Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6476287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:48:24+00:00 2026-05-25T06:48:24+00:00

I am looking to take an icon that is colored (and will be a

  • 0

I am looking to take an icon that is colored (and will be a link) and turn it greyscale until the user places their mouse over the icon (where it would then color the image).

Is this possible to do, and in a way that is IE & Firefox supported?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:48:25+00:00Added an answer on May 25, 2026 at 6:48 am

    There are numerous methods of accomplishing this, which I’ll detail with a few examples below.

    Pure CSS (using only one colored image)

    img.grayscale {
      filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 3.5+ */
      filter: gray; /* IE6-9 */
      -webkit-filter: grayscale(100%); /* Chrome 19+ & Safari 6+ */
    }
    
    img.grayscale:hover {
      filter: none;
      -webkit-filter: grayscale(0%);
    }
    
    img.grayscale {
      filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale");
      /* Firefox 3.5+, IE10 */
      filter: gray;
      /* IE6-9 */
      -webkit-filter: grayscale(100%);
      /* Chrome 19+ & Safari 6+ */
      -webkit-transition: all .6s ease;
      /* Fade to color for Chrome and Safari */
      -webkit-backface-visibility: hidden;
      /* Fix for transition flickering */
    }
    
    img.grayscale:hover {
      filter: none;
      -webkit-filter: grayscale(0%);
    }
    
    svg {
      background: url(http://4.bp.blogspot.com/-IzPWLqY4gJ0/T01CPzNb1KI/AAAAAAAACgA/_8uyj68QhFE/s400/a2cf7051-5952-4b39-aca3-4481976cb242.jpg);
    }
    
    svg image {
      transition: all .6s ease;
    }
    
    svg image:hover {
      opacity: 0;
    }
    <p>Firefox, Chrome, Safari, IE6-9</p>
    <img class="grayscale" src="http://4.bp.blogspot.com/-IzPWLqY4gJ0/T01CPzNb1KI/AAAAAAAACgA/_8uyj68QhFE/s1600/a2cf7051-5952-4b39-aca3-4481976cb242.jpg" width="400">
    <p>IE10 with inline SVG</p>
    <svg xmlns="http://www.w3.org/2000/svg" id="svgroot" viewBox="0 0 400 377" width="400" height="377">
      <defs>
         <filter id="filtersPicture">
           <feComposite result="inputTo_38" in="SourceGraphic" in2="SourceGraphic" operator="arithmetic" k1="0" k2="1" k3="0" k4="0" />
           <feColorMatrix id="filter_38" type="saturate" values="0" data-filterid="38" />
        </filter>
      </defs>
      <image filter="url(&quot;#filtersPicture&quot;)" x="0" y="0" width="400" height="377" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://4.bp.blogspot.com/-IzPWLqY4gJ0/T01CPzNb1KI/AAAAAAAACgA/_8uyj68QhFE/s1600/a2cf7051-5952-4b39-aca3-4481976cb242.jpg" />
       </svg>

    You can find an article related to this technique here.

    Pure CSS (using a grayscale and colored images)

    This approach requires two copies of an image: one in grayscale and the other in full color. Using the CSS :hover psuedoselector, you can update the background of your element to toggle between the two:

    #yourimage { 
        background: url(../grayscale-image.png);
    }
    #yourImage:hover { 
        background: url(../color-image.png};
    }
    
    #google {
      background: url('http://www.google.com/logos/keystroke10-hp.png');
      height: 95px;
      width: 275px;
      display: block;
      /* Optional for a gradual animation effect */
      transition: 0.5s;
    }
    
    #google:hover {
      background: url('https://graphics217b.files.wordpress.com/2011/02/logo1w.png');
    }
    <a id='google' href='http://www.google.com'></a>

    This could also be accomplished by using a Javascript-based hover effect such as jQuery’s hover() function in the same manner.

    Consider a Third-Party Library

    The desaturate library is a common library that allows you to easily switch between a grayscale version and full-colored version of a given element or image.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for a Regex that will take this: ?pm=512862895835 And turn it into
Im looking for a script that will take OData feed and download some .wmv
I am looking to take text from a box that will be something like
I'm looking for a Java library that will can take a Image (PNG) and
I am looking for a tool which will take an XML instance document and
I am looking to take data that is currently wide and melt it into
I'm looking to take a string and create a list of strings that build
i'm looking for a script that would take a print screen of a web
I'm looking to take an object that contains String and Integer context and that
I am looking to take a view hierarchy and turn it into a Bitmap.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.