Syntax error Set Grayscale Effect with CSS

Set Grayscale Effect with CSS



The grayscale effect is used to convert the colors of the object to 256 shades of gray. The following parameter is used in this filter −

Parameter Description
Gray Converts the colors of the object to 256 shades of gray.

Example

You can try to run the following code to set grayscale effect −

Live Demo

<html>
   <head>
   </head>
   <body>
      <img src = "/css/images/logo.png" alt = "CSS Logo" style = "Filter: Gray">
      <p>Text Example:</p>
      <div style = "width: 357;
         height: 50;
         font-size: 30pt;
         font-family: Arial Black;
         color: red;
         Filter: Gray">
         CSS Tutorials
      </div>
   </body>
</html>
Updated on: 2020-06-27T12:23:29+05:30

253 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements