HTML Quotations

HTML Quotations Explained

What are HTML Quotations?

HTML Quotations are special tags used to display quoted text, abbreviations, citations, addresses, or text with special meaning in a webpage. They help structure text semantically so browsers, search engines, and readers understand whether the text is a quotation, a citation, an abbreviation, or formatted in a specific direction. Using these tags also improves accessibility and ensures proper styling by default.

<blockquote> — Block Quotation

  1. Used for long quotations (usually spanning multiple lines).
  2. The browser usually displays it as indented text.
  3. To indicate the source, you can include the cite attribute.
<!DOCTYPE html> <html> <head> <title>Block Quotation Example</title> </head> <body> <blockquote> "The journey of a thousand miles begins with a single step." </blockquote> </body> </html>

<q> — Inline Quotation

  1. Used for short, inline quotations.
  2. Browsers automatically add quotation marks.
  3. Fits inside a sentence.
<!DOCTYPE html> <html> <head> <title>Inline Quotation Example</title> </head> <body> <p>She said, <q>Hard work always pays off.</q></p> </body> </html>

<cite> tag— Citation

  1. Used to reference the title of a work (book, website, research paper, etc.).
  2. Browsers usually italicize the content.
  3. Not meant for URLs directly — use <a> for clickable links.
<!DOCTYPE html> <html> <head> <title>Citation Example</title> </head> <body> <p><cite>The Great Gatsby</cite> was written by F. Scott Fitzgerald.</p> </body> </html>

<bbr> tag — Abbreviation or Acronym

The <abbr> tag defines abbreviations or acronyms, and the title attribute shows the full form when hovered over. Users and accessibility tools like screen readers benefit from this increase in clarity.

<!DOCTYPE html> <html> <head> <title>Abbreviation or Acronym Example</title> </head> <body> <p>The <abbr title="World Health Organization">WHO</abbr> was founded in 1948.</p> </body> </html>

<address> tag — Contact Information

The <address> tag is used to display contact details for the author or owner of a webpage. This can include things like an email address, website link, or physical address. By default, most browsers show <address> content in italics.

<!DOCTYPE html> <html> <head> <title>Address Example</title> </head> <body> <address> Written by John Doe.<br> Visit us at example.com<br> 123 Main Street, USA </address> </body> </html>

<bdo> — Bi-Directional Override

The <bdo> tag is used to change the direction of text display, either left-to-right (ltr) or right-to-left (rtl). This is useful for languages that use different writing directions.

<!DOCTYPE html> <html> <head> <title>Address Example</title> </head> <body> <p>Normal: Hello</p> <p><bdo dir="rtl">Hello</bdo></p> </body> </html>

Previous Post Next Post