Forum How do I...?

Generated smart quotes?

jean
I want to put quotes around GUI elements:

.guimenu::before, .guimenuitem::before, .guibutton::before,
.guilabel::before,
.guimenu::after, .guimenuitem::after, .guibutton::after,
.guilabel::after {
    content: '"'; /* Aargh, " doesn't work :-( */
}


Why doesn't " work there? The plain " character looks bad in print ..
jean
With the CSS in the preceding message, xref text gets redoubled quotes.

This HTML (generated by DocBook XSL):
(see <a class="xref" href="#subscribe_to_asset__section" title="2.&nbsp;Subscribe to Asset">Section&nbsp;2, &ldquo;</a><a name="subscribe_to_asset__task" id="subscribe_to_asset__task"></a><a class="xref" href="#subscribe_to_asset__section" title="2.&nbsp;Subscribe to Asset"><span class="guimenuitem">Subscribe to Asset</span>&rdquo;</a>)


Results in this text in the PDF:

(see Section 2, “"""Subscribe to Asset"”)
David J Prokopetz
jean wrote:
Why doesn't &quot; work there? The plain " character looks bad in print ..

If I recall correctly, you can't use most entity references in CSS. You have to use escape codes instead. Something like this:

<para>
	This is <quote>quoted material</quote>.
</para>


quote::before { content: "\201C"; }
quote::after { content: "\201D"; }


A character's escape code is simply the hex value of the corresponding character code; if you're running Windows, you can look it up in the Character Map utility.
jean
David J Prokopetz wrote:
quote::before { content: "\201C"; }
quote::after { content: "\201D"; }



Beautiful! Thank you :-)