Q surrounds a short quotation that fits within a sentence. Browsers can display quotation punctuation around it.
What You Need to Know
For a longer passage that stands alone, use blockquote instead. Avoid typing a second pair of quotation marks around q unless the surrounding language calls for them.
The goal is not to collect as many tags as possible. Pick the element that best describes what the content really is.
Example: See It in Action
This example keeps the idea small. Copy it carefully, then follow the explanation instead of guessing what the browser will do.
This is a short HTML fragment. To try it as a webpage, put it inside the body element of a complete HTML document.
<p>Sam said, <q>Practice makes progress.</q>
</p>
<p>Short quotations can fit inside a sentence.</p>
<p>The browser may supply quotation marks.</p>
Let’s Understand the Example
- Q wraps a short quotation within the surrounding sentence.
- A p groups a paragraph of related text. Start another paragraph for a new thought.
Look for the text “Sam said,” in the page. If the visible result surprises you, inspect the rendered elements to see what the browser actually built.
What Should You See?
The page should include “Sam said,”. If it looks different from what you expected, open developer tools and compare the source with the elements the browser created.
Try removing one piece of markup in a scratch copy, refresh the page, and compare the behavior. This is often the fastest way to understand what that piece contributes.
Try It Yourself
- Quote a short phrase in a sentence and observe the browser punctuation.
- Save your changes, open or refresh the page, and compare the result with the original example.
- Tell a friend what your change did. If you are not sure, undo it, refresh the page, and compare.
Common Beginner Mistakes
- Adding visible quotation marks around q and ending up with double quotation marks.
- Avoid picking tags just for their default bold, italic or spaced appearance. Use CSS for presentation.
Key Takeaways
- Q surrounds a short quotation that fits within a sentence.
- Q wraps a short quotation within the surrounding sentence.
- For a longer passage that stands alone, use blockquote instead. Avoid typing a second pair of quotation marks around q unless the surrounding language calls for them.