Tiny Online Tools logoTiny Online ToolssearchПоиск инструментов…grid_viewВсе инструменты
Главнаяchevron_rightИнструменты для изображенийchevron_rightSVG в фон CSSSVG в фон CSS

SVG в фон CSS

Конвертируйте SVG-код в URL данных для background-image CSS.

Входной SVG
Предпросмотр SVG
Выходные данные CSS
background-image (URL-encoded — рекомендуется)
css
background-image (base64)
css
сокращение background (URL-encoded)
css
сокращение background (base64)
css
CSS-переменная (URL-encoded)
css
CSS-переменная (base64)
css

Похожие инструменты

PDF в SVG

PDF в SVG

Конвертируйте страницы PDF в масштабируемые векторные SVG-файлы прямо в браузере.

Изображение в Base64

Изображение в Base64

Конвертируйте файлы изображений в строки Base64.

Base64 в изображение

Base64 в изображение

Декодируйте строки Base64 в файлы изображений.

SVG в JSX

SVG в JSX

Конвертируйте SVG-разметку в React JSX-компонент с правильными camelCase-атрибутами.

удалить дубликат строки

удалить дубликат строки

удалить дубликат строки из text.

Markdown в HTML

Markdown в HTML

преобразовать Markdown в HTML instantly с live preview.

PDF в текст

PDF в текст

Мгновенно извлекайте обычный текст из PDF-файлов прямо в браузере. Без загрузки на сервер и без регистрации.

apps

Больше инструментов

Просмотрите нашу полную коллекцию бесплатных онлайн-инструментов.

SVG to CSS Background

Embed SVG graphics directly in your stylesheets as CSS background-image data URLs. This technique eliminates HTTP requests for small icons and patterns, improving page load performance.

Data URL encoding methods

The tool Генерируетs two encoding options: base64 and URL-encoded Форматируетs. Base64 encoding works everywhere but produces slightly larger output. URL-encoded Форматирует is more human-readable and often smaller, making it ideal when you need to inspect or modify SVG colors directly in CSS.

Multiple CSS output Форматируетs

Get the SVG as background-image properties, complete background shorthand rules, or CSS custom properties for reusability. Copy any Форматирует and paste directly into your stylesheet. The tool Генерируетs working CSS immediately—no manual tweaking required.

Performance Преимущества

Inlining SVG backgrounds eliminates the file request overhead of separate icon files. This matters most for small decorative graphics, loading spinners, and backgrounds. Modern браузерs handle data URLs efficiently, making this approach ideal for responsive websites where every HTTP request impacts load time.

Design system integration

Создает a library of SVG patterns and icons as CSS variables for consistent styling across components. Modify colors in your CSS without touching image files, enabling theme switching and dynamic styling.

Practical applications

Embed company logos in email template CSS, Создает decorative backgrounds without additional HTTP requests, style checkbox and radio button designs with inline SVG, Генерирует pattern fills for data visualizations, and build accessible icon systems with scalable graphics.