w3resource

HTML5: How to specify the source URL of the quote?

Go to Exercise page

Solution:

HTML Code:

<!DOCTYPE html<<!-- Define document type as HTML5 --<
<html<<!-- Start of HTML document --<
<head<<!-- Start of head section --<
<meta charset="utf-8"<<!-- Define character encoding --<
<title<How to specify the source URL of the quote</title<<!-- Title of the document --<
</head<<!-- End of head section --<
<body<<!-- Start of body section --<
<p<<q 
cite="https://www.w3resource.com/html/
HTML-tutorials.php"<HTML, stands for 
Hyper Text Markup Language</q<</p<<!-- Define a paragraph with a quoted text and a citation --<
</body<<!-- End of body section --<
</html<<!-- End of HTML document --<

Explanation:

  • This HTML code demonstrates how to specify the source URL of a quote using the cite attribute within the <q< element.
  • Inside a <p< (paragraph) element, a quoted text is included using the <q< element, indicating that it is a quotation.
  • The cite attribute within the <q< element specifies the source URL of the quotation, in this case, "https://www.w3resource.com/html/HTML-tutorials.php".
  • The text "HTML, stands for Hyper Text Markup Language" is the quoted text.
  • Including a cite attribute provides a means to attribute the quote to its original source, enhancing credibility and providing context for the quote.

Live Demo:

See the Pen q-cite-answer by w3resource (@w3resource) on CodePen.


See the solution in the browser

Supported browser

Firefox logo Chrome logo Opera logo Safari logo Internet Explorer logo
Yes Yes Yes Yes Yes

Go to Exercise page

What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.



Follow us on Facebook and Twitter for latest update.