G
G
Grishan Trudovik2017-05-09 01:42:54
css
Grishan Trudovik, 2017-05-09 01:42:54

How to insert svg with css?

ни один из вариантов ниже не работает
использую Хром

background: url('../img/svg/header3stars.svg') no-repeat center

background: url('
data:image/svg+xml;utf8,
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="179" height="30" viewBox="0 0 179 30">  
<image id="header3stars.svg" data-name="Векторный смарт-объект.svg" width="179" height="30" xlink:href="data:img/png;base64,iVBORw0KGgoAAAANSUhEUgAAALMAAAAeCAMAAABQSN/xAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAB71BMVEUAAADNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvNtHvN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AnMWaKdFmlaLnuHLsMrP5VhKzBoWQY9k6Q9snQV3vm5DHsBg1ZlkPSY5RJv47WAcNUF7/xSICyvrMLVaxjUJbw8sCaeol2SNIX8KTOEgm9I7oN3fkuwd7no/Sz5AP4Ag8ijzvQxiEKfiCn98YV/p69v8Neb1ZGJcwvcuTDyegf56P+cB38KbfFf9r5s8pONdX5TJTF3sNn+GhZnw5Hj6Si48zeMrd3fxdkPM4dtQpxR7oV9e8fB8M9t7lAniX85G6TP0LBrfmcX3DnekPpbMjWu/En8C3F2d+ZdYcl8scFJfrT8B/guN3e2cpP1AAAAAElFTkSuQmCC"/>
</svg>
')

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Lumore, 2017-05-09
@Lumore


none of the options below work
using chrome
background: url('../img/svg/header3stars.svg') no-repeat center
Check Image Path

P
profesor08, 2017-05-09
@profesor08

1. Make sure the path to the image is correct (F12).
2. Make sure the size of the image is correct, as it may have transparent edges and be larger than the block size, and as a result will not be visible.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question