Html – Multiple “style” attributes in a “span” tag: what’s supposed to happen


Consider the following HTML fragment with two style attributes:

<span style="color:blue" style="font-style:italic">Test</span>

In Opera 12.16 and Chrome 40, it shows up as blue non-italic text, while Internet Explorer 9 shows blue italic text. What, if anything, does the standard say is supposed to show up?

Best Answer

Separate your rules with a semi colon in a single declaration:

<span style="color:blue;font-style:italic">Test</span>