function
Url() — CSS reference
References a resource in CSS contexts that accept a URL, such as background-image or font sources. Relative resource references normally resolve against the stylesheet URL; local fragment references have special scoping rules. Quote values with spaces or punctuation. This standalone example uses an embedded SVG without network access; meaningful images need appropriate HTML semantics.
Formal Syntax & Structure
css syntaxcss
url("image.svg")Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>url()</title><style>body{margin:8px;font:16px/1.5 sans-serif}*{box-sizing:border-box}#a{width:80px;height:60px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='60'%3E%3Crect width='80' height='60' fill='blue'/%3E%3C/svg%3E")}</style><body><div id="a" aria-hidden="true"></div><p>Decorative blue swatch</p></body></html>