Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML HTML Text Quotes

Why is the cite attribute only meant for URLs, o?

Is there a 'source' attribute, so one can tell where the quote came from, such as book, or page number ?

2 Answers

Ben Attenborough
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Ben Attenborough
Front End Web Development Techdegree Graduate 32,769 Points

According to https://developer.mozilla.org/en-US/docs/Web/HTML/Element/cite

"The HTML <cite> Element (or HTML Citation Element) represents a reference to a creative work. It must include the title of a work or a URL reference, which may be in an abbreviated form according to the conventions used for the addition of citation metadata.

Usage Notes:

  • A creative work may include a book, a paper, an essay, a poem, a score, a song, a script, a film, a TV show, a game, a sculpture, a painting, a theater production, a play, an opera, a musical, an exhibition, a legal case report, a computer program, , a web site, a web page, a blog post or comment, a forum post or comment, a tweet, a written or oral statement, etc.
  • Use the cite attribute on a <blockquote> or <q> element to reference an online resource for a source."

Yes, you can do it like this:

<blockquote>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
<cite>Somebody famous</cite>
</blockquote>