L
L
lynnikvadim2015-09-15 23:55:40
PHP
lynnikvadim, 2015-09-15 23:55:40

How to style SVG?

There is an entry in the database with a link to the svg file.
The output of the file is produced using the code: <embed src="{{$Post->svg}}" class="icon" />
As a result, I have the following code:

<embed src="/site/img/category/sedan3.svg" class="icon"   />

The picture is displayed, everything is fine. But the style can't do for her.
How can I style svg ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Volintsev, 2015-09-24
@copist

If style means a frame around the picture, then it is easy

.icon {
    border: 1px solid red;
}

And if you need access to individual lines, then do not use embed, but insert directly into HTML.
Here is an example: changing the visibility and color of elements codepen.io/copist/pen/WvVRRL

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question