0

To include a quotation in HTML, one could simply use quotation symbols:

<p>“Yes,” he said.</p>

Alternatively, one could use the inline quotation element:

<p><q>Yes,</q> he said.</p>

Using the inline quotation element has some advantages, e.g., it provides additional semantic information to any person or machine reading the HTML code.

However, I noticed something that seems to me like a severe disadvantage of the inline quotation element. In all the browsers I've tried, although quotation symbols are rendered, it is not possible to select the quotation symbols. Screenshot of quotation symbols not being selected

In Chrome and Edge, predictably, this means that the quotation symbols are omitted if the user copies and pastes. In Firefox, interestingly, quotation symbols are inserted in the pasted text, even though they do not appear to be selected.

This behavior seems jarring for the user. Is it really the best practice for quotations in HTML? When, if ever, should developers use the inline quotation element?

  • 1
    This is not a UI/UX question but an implementation and HTML question. I don't know that there is a stack exchange site for this except, perhaps, softwareengineering.stackexchange.com No, SO would not be the place. – Rob Dec 4 '19 at 4:34
  • @william-hoza Are you sure sbout Chrome and Edge not copying the symbols? I just attempted to copy it from both Chrome and Firefox and the quotes were copied. But what was interesting was the way they get rendered. I can't select the quotation symbols from the pasted text but they get copied when I copy them. Note - I did this on a Macbook, so I pasted the text on the Notes app. I could test it later on a Windows 10 system and see if the behavior changes while using Notepad – Shreyas Tripathy Dec 4 '19 at 5:42
  • @ShreyasTripathy I think your clipboard copied the HTML. The quotation marks get inserted by CSS, so they're not actually considered to be part of the content. I can verify the behavior OP witnessed. – maxathousand Dec 4 '19 at 17:12
  • 1
    @Rob I disagree. I think this question is focused on the user impact of using a standard HTML element. In other words, it's not asking how to do something, but rather how does using this affect the user. – maxathousand Dec 4 '19 at 17:16
  • @maxathousand The two questions in his last paragraph makes me not think that. – Rob Dec 4 '19 at 18:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.