Home  >  Article  >  Web Front-end  >  Convert an object's color to 256 levels of grayscale using CSS

Convert an object's color to 256 levels of grayscale using CSS

WBOY
WBOYforward
2023-08-25 15:53:02823browse

使用 CSS 将对象的颜色转换为 256 级灰度

Use the grayscale effect to convert the color of the object to 256 levels of grayscale. The following parameters are used in this filter:

Parameters

Description

Gray

Gray

Converts the color of the object to 256 levels of gray.

Example

You can try running the following code to set the 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>

The above is the detailed content of Convert an object's color to 256 levels of grayscale using CSS. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete