With the intent of catering to screen readers and being semantically correct, which is the correct way to display an italicized "required" or "optional" label in a HTML form?
<i>*required</i>
<em>*required</em>
<span class="italic">*required</span>
*<span class="italic">
equating to font-style="italic"
in CSS
Arguably, neither
<em>
nor<i>
is semantically correct. Your question already presumes that you want the text to visually be italic, not that you want it to be emphasized nor recognized as foreign text, the name of a ship, and so on.That being said, a neutral element is likely your best bet, such as
<span>
, to avoid imparting semantic meaning where this none. Also, a screen reader will not announce the text any differently if you use<em>
or<i>
.You can take it another step and skip adding an element altogether and use CSS to add the content for you (provided you support only one language and/or have an easy way to do CSS per language):
Or the inverse:
Screen readers announce CSS generated content, in case you are worried that might be an issue.