title-Attribute in any SVG-Element allowed?

2,157 views
Skip to first unread message

lesscaffee

unread,
Jun 3, 2010, 5:04:25 PM6/3/10
to SVG Web
hi,

well reading out the svg-reference, there is no clue saying that it is
allowed in setting the title-attribute in any svg-element (as you can
do it in html) for example:
<rect id="rect1" title="my first rect!" x="" .../>

maybe it is allowed, is it? :)

thanks for help (i'm new in svg)

best regards

Jamie Love

unread,
Jun 3, 2010, 5:33:54 PM6/3/10
to svg...@googlegroups.com
Hi there,

"title" is a core SVG attribute, and to my knowledge every single SVG
element includes all core attributes,

so yes, title is available for all SVG elements.

> --
> You received this message because you are subscribed to the Google Groups "SVG Web" group.
> To post to this group, send email to svg...@googlegroups.com.
> To unsubscribe from this group, send email to svg-web+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/svg-web?hl=en.
>
>

--
Jamie Love
Looking for custom software development? Contact us at www.nsquaredsoftware.com.

Bradley Neuberg

unread,
Jun 3, 2010, 7:57:22 PM6/3/10
to svg...@googlegroups.com
I thought that the title was a nested element.

Jamie Love

unread,
Jun 4, 2010, 4:45:28 AM6/4/10
to svg...@googlegroups.com
Whoops, yes you're right Brad, I was reading the documentation I had
wrong - it's an element - designed to be a subelement to any of the
drawing/container/text elements in SVG -

<rect ...>
<title>
my tooltip
</title>
</rect>

user agents are free to show the title in whatever way they like.

Jamie

lesscaffee

unread,
Jun 4, 2010, 10:27:29 AM6/4/10
to SVG Web
hey guys, thanks for answering...
well title is as an own element specified in SVG, not specified as an
attribute in a SVG-Element.

But every SVG-Element is also an DOM-Element, so is it possible to
define in a SVG-Element any attribute or the title attribute, even
when it is not specified in SVG, for example in doing this:
<rect id="rect1" title="my first rect!" x="" .../>

would that cause any trouble???


On 4 Jun., 10:45, Jamie Love <drjl...@gmail.com> wrote:
> Whoops, yes you're right Brad, I was reading the documentation I had
> wrong - it's an element - designed to be a subelement to any of the
> drawing/container/text elements in SVG -
>
> <rect ...>
> <title>
> my tooltip
> </title>
> </rect>
>
> user agents are free to show the title in whatever way they like.
>
> Jamie
>
>
>
> On Fri, Jun 4, 2010 at 11:57 AM, Bradley Neuberg <bradneub...@gmail.com> wrote:
> > I thought that the title was a nested element.
>
> > On Thu, Jun 3, 2010 at 2:33 PM, Jamie Love <drjl...@gmail.com> wrote:
>
> >> Hi there,
>
> >> "title" is a core SVG attribute, and to my knowledge every single SVG
> >> element includes all core attributes,
>
> >> so yes, title is available for all SVG elements.
>
> >> On Fri, Jun 4, 2010 at 9:04 AM, lesscaffee <lesscaf...@googlemail.com>

Jamie Love

unread,
Jun 4, 2010, 4:11:37 PM6/4/10
to svg...@googlegroups.com
On Sat, Jun 5, 2010 at 2:27 AM, lesscaffee <lessc...@googlemail.com> wrote:

>
> But every SVG-Element is also an DOM-Element, so is it possible to
> define in a SVG-Element any attribute or the title attribute, even
> when it is not specified in SVG, for example in doing this:
> <rect id="rect1" title="my first rect!" x="" .../>
>

My understanding is that SVG can be considered "DOM-like" in web
browsers, but it isn't the same as the HTML DOM.

As SVG is just XML, it follows the same rules - that is you can add
whatever attributes you like, but it won't necessary validate when
passed through a XML validator.

Reply all
Reply to author
Forward
0 new messages