property

filter — CSS reference

Processes the rendered element as a group using an ordered list of filters. Initial none; not inherited. Non-none creates a stacking context and generally a containing block for positioned descendants (with a document-root exception). Effects run in written order. Use effects decoratively and check contrast and rendering cost.

Formal Syntax & Structure

css syntaxcss
none | [ <filter-function> | <url> ]+

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS visual effects lab</title><style>body {margin:0} .sample {background:#dcebe9;color:#182e32}body{background:white} #a{position:relative; margin:20px;width:80px;height:60px;background:rgb(255,0,0);box-sizing:content-box} #a{filter:invert(1) brightness(0)}</style><body><div id="a" aria-hidden="true"></div><p>Decorative effect example.</p></body></html>
CSS Reference