Home > Web Front-end > CSS Tutorial > 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
Release: 2023-08-25 15:53:02
forward
879 people have browsed it

使用 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>
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template