views:

52

answers:

3

I wish to have the following:

<span title="This is a "good" title.">Catch me in the rice.</span>

It is obvious that this is not rendered well by the browsers. Please provide me with information of what escape sequence or encoding like " I must use?

+5  A: 

Use &quot; instead.

gms8994
That was fast. let me try this.
Gad D Lord
A: 
<span title="This is a &quot;good&quot; title.">Catch me in the rise.</span>
Gordon Bell
A: 

Either replace the quotation mark with its corresponding HTML entity (&quot;) or its ISO Latin-1 code (&#34;) — like this:

<span title="This is a &quot;good&quot; title.">Catch me in the rice.</span>
<span title="This is a &#34;good&#34; title.">Catch me in the rice.</span>

Alternatively you can use single quotes in your HTML in cases where you need double quotes in attribute values:

<span title='This is a "good" title.'>Catch me in the rice.</span>
Mathias Bynens
Single quotes will not work when the text he needs has a single quote in it... always use the entity.
gms8994
@gms8994 Well of course stuff like `<foo bar='bar'baz'>` won’t work — I’m pretty sure the OP knows that, seeing as he asked a similar question (`<foo bar="bar"baz">`).
Mathias Bynens