How to put quotes between other quotes in HTML

Viewed 60
<p>
  <span title="This tooltip "has quotes in the middle" of it."></span>
</p>

I want to use " characters, inside enclosing " characters.

How can I do this?

3 Answers

Use HTML character entity:

&quot;

The thing is, that some characters are reserved in HTML, and rendering engines parse them as HTML code. "<", for instance, denotes an opening angle bracket in HTML tag syntax; """ is also an HTML syntax element, used for enclosing attribute values in the HTML element; so on. See other entities here.

In order to use literal representation of those reserved characters, in your HTML code, you should use respective HTML entities.

<p>
<span title="This tooltip "has quotes in the middle" of it."></span>
</p>

You can replace those quotes with a HTML entity - the HTML entity for a " is &quot;

The HTML element indicates that the enclosed text is a short inline quotation. Most modern browsers implement this by surrounding the text in quotation marks. This element is intended for short quotations that don't require paragraph breaks; for long quotations use the element

Related