<codeph>

A code phrase is a small portion of source code, machine code, or text that is displayed in-line.

Rendering expectations

The content of the <codeph> element is typically rendered in a monospaced font.

Specialization hierarchy

The <codeph> element is specialized from <ph>. It is defined in the programming domain module.

Content model

(Text | <cite> | <include> | <keyword> | <markupname> | <apiname> | <option> | <parmname> | <cmdname> | <msgnum> | <varname> | <wintitle> | <numcharref> | <parameterentity> | <textentity> | <xmlatt> | <xmlelement> | <xmlnsname> | <xmlpi> | <ph> | <strong> | <em> | <b> | <i> | <line-through> | <overline> | <sup> | <sub> | <tt> | <u> | <hwcontrol> | <partno> | <codeph> | <filepath> | <msgph> | <systemoutput> | <userinput> | <synph> | <menucascade> | <uicontrol> | <q> | <term> | <abbreviated-form> | <text> | <xref> | <data> | <sort-as> | <draft-comment> | <foreign> | <required-cleanup> )*

Attributes

The following attributes are available on this element: universal attributes and @keyref.

The following attributes are available on this element: universal attributes and the attributes defined below.

@keyref
Specifies a key name that acts as a redirectable reference based on a key definition within a map. See STUB CONTENT for information on using this attribute.

For HDITA, the equivalent of @keyref is @data-keyref

Example

This section is non-normative.

In the following code sample, the <codeph> element identifies a code snippet. The code snippet will be rendered in-line in the paragraph.

<p>The second line of the sample program code, <codeph>Do forever</codeph>, 
represents the start of a loop construct.</p>