Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
-1
rated 0 times [  4] [ 5]  / answers: 1 / hits: 17015  / 8 Years ago, tue, may 3, 2016, 12:00:00

Can i put multiple svgs in a html page and use the same IDs in all of them?



<div>
<svg height=0 width=0>
<clipPath id=svgPath> ........
</svg>
<svg height=0 width=0>
<clipPath id=svgPath> ........
</svg>
<svg height=0 width=0>
<clipPath id=svgPath> ........
</svg>
</div>

More From » html

 Answers
16

Since the specs define the id attribute as unique per document, you should refactor the IDs or use an alternative, e.g. embedding via img or object tag.



<img src=my.svg height=100 alt=alternative Text>

<object type=image/svg+xml data=my.svg width=100 height=100></object>

[#62324] Friday, April 29, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
yaquelina

Total Points: 517
Total Questions: 101
Total Answers: 96

Location: Egypt
Member since Tue, Jul 6, 2021
3 Years ago
yaquelina questions
;