These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:23 pm Advanced search

Question about dfn element's title attribute

If you are stuck or have questions regarding HTML or other Web technologies, ask your questions here. No question too dumb!

Question about dfn element's title attribute

Postby Aude_sapere » Thu Dec 22, 2011 1:18 am

I understand that dfn tags enclose a term, and the definition of that term must follow.

What I'm unclear about, is how the title attribute works. Does the term and its title have to be the same word or phrase?

For example, suppose I wanted to have the sentence, <dfn>Black</dfn> is the absence of light, but with a title attribute in the dfn tag. Must the value of that title be "black" as shown in the following sentence: <dfn title="black">Black</dfn> is the absence of light. If not, what else could it be?

I hope this is a simple question for someone.

Oh, and Happy Holidays!
Aude_sapere
<h6>
 
Posts: 2
Joined: Thu Dec 22, 2011 12:48 am

Re: Question about dfn element's title attribute

Postby vivian » Mon Dec 26, 2011 12:02 pm

If the dfn element has a title attribute, then the exact value of that attribute is the term being defined. Otherwise, if it contains exactly one element child node and no child text nodes, and that child element is an abbr element with a title attribute, then the exact value of that attribute is the term being defined. Otherwise, it is the exact textContent of the dfn element that gives the term being defined.

If the title attribute of the dfn element is present, then it must contain only the term being defined.

src: http://www.w3.org/TR/html5/text-level-semantics.html#the-dfn-element

:)
vivian
<h6>
 
Posts: 1
Joined: Mon Dec 26, 2011 11:22 am


Return to Help & Advice

Who is online

Users browsing this forum: No registered users and 0 guests