property

Fill rule — CSS reference

Determines the interior of intersecting or nested subpaths by parity of crossings. The inner rectangle is a hole even though both subpaths have the same winding direction; nonzero would fill it.

Formal Syntax & Structure

css syntaxcss
fill-rule: evenodd;

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>fill-rule</title><style>body{margin:0;background:white}svg{display:block}#a{fill-rule:evenodd}#a{fill:red}</style><body><svg xmlns="http://www.w3.org/2000/svg" width="240" height="160" viewBox="0 0 240 160" role="img" aria-label="SVG styling example"><path id="a" d="M20 20 H180 V140 H20 Z M60 60 H140 V100 H60 Z"/></svg></body></html>
CSS Reference