Html: Add definition for var tag correctly.

I have this piece of code.

<cite>Einstien</cite> calculated that <var>E</var>=<var>m</var><var>c</var><sup>2</sup>

      

but it feels incomplete.

While the tag var

is semantically correct, it cannot tell the user what var is like E = energy

it would be correct to use an attribute title

or cite

to define what var represents something like <var title="energy">E</var>

or<var cite="energy">E</var>

Any help is appreciated.

+3


source to share


1 answer


You can use the attribute title

.



According to the W3C, an attribute title

is applied to an element var

through a global set of attributes (sources: var Element , HTML5 Specification ).

+4


source







All Articles