In HTML, the <q> element is used to define a short inline quotation. The <q> element is used to enclose the quoted text, and browsers typically render it with quotation marks.
Here's an example of how the <q> element is used:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML Quotation Example</title>
</head>
<body>
<p>The <q>quick brown fox</q> jumps over the lazy dog.</p>
</body>
</html>
In this example:
- The text "quick brown fox" is enclosed within the <q> element.
- Browsers will typically render the quoted text with quotation marks.
It's important to note that the <q> element is specifically designed for short, inline quotations. For longer block quotations, you should use the <blockquote> element.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML Quotation with Output Example</title>
</head>
<body>
<blockquote>
<p>The only way to do great work is to love what you do.</p>
<footer>- Steve Jobs</footer>
</blockquote>
</body>
</html>