C
C
Cheizer2020-07-22 19:18:19
css
Cheizer, 2020-07-22 19:18:19

How to change stroke color in SVG?

Can you please tell me how to change the color in SVG stroke to a color in HEX or RGB format?
The main problem is that SVG is used in CSS background-image, this condition is important.

background-image: url("data:image/svg+xml;utf8,<svg width='100%' height='100%' xmlns='http://www.w3.org/2000/svg'><line id='simple' x1='0' y1='0' x2='300' y2='0' stroke='black' stroke-width='5' stroke-dasharray='5' /></svg>");


Here is an example, black dotted line, how to change its color?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2020-07-22
@Cheizer

stroke='rgb(255,0,0)'
https://jsfiddle.net/nw0gcsqp/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question