content icon indicating copy to clipboard operation
content copied to clipboard

"use" svg example has errors

Open georgernstgraf opened this issue 2 years ago • 3 comments

MDN URL

https://developer.mozilla.org/en-US/docs/Web/SVG/Element/use

What specific section or headline is this issue about?

Example

What information was incorrect, unhelpful, or incomplete?

The third circle was obviously meant to have a red stroke which it does not have, neither in a current firefox nor edge browser. The third circle is still displayed blue.

It's about this line:

<use href="#myCircle" x="20" fill="white" stroke="red" />

What did you expect to see?

a red circle on the right.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details
  • Folder: en-us/web/svg/element/use
  • MDN URL: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/use
  • GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/svg/element/use/index.md
  • Last commit: https://github.com/mdn/content/commit/2f43f506240fa6c866cc3bc2d018364ae49421d9
  • Document last modified: 2024-04-02T11:27:49.000Z

georgernstgraf avatar Jul 10 '24 13:07 georgernstgraf

Thanks for reporting this one. I think you may have missed the prose above the example:

https://developer.mozilla.org/en-US/docs/Web/SVG/Element/use#example

The following example shows how to use the use element to draw a circle with a different fill and stroke color. In the last circle, stroke="red" will be ignored because stroke was already set on myCircle.

Does that make sense?

bsmth avatar Jul 10 '24 14:07 bsmth

Oh it does. I'm sorry, and thank you too!

georgernstgraf avatar Jul 10 '24 14:07 georgernstgraf

Great, I'm glad that's cleared up 🙌🏻

bsmth avatar Jul 10 '24 14:07 bsmth