Working with Specialized Semantic Elements - How Do You Display Mathematical Equations and Chemical Formulas in HTML?

Tell us what’s happening:

It seems that “It is important to note that the superscript element should only be used for typographical reasons. If you want to style a piece of text with a raised baseline, then you should use CSS instead of the superscript element.” contradicts the third question, or maybe I somehow misreading it, can somebody please explain? Thank you in advance.

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36

Challenge Information:

Working with Specialized Semantic Elements - How Do You Display Mathematical Equations and Chemical Formulas in HTML?

Welcome back to the forum @EmilD

The sub element is used for styling exponents, superior lettering, and ordinal numbers.

If you want similar styling for other text, then use CSS instead of the sub element.

sub is a semantic element, so is used by assistive technologies.

Happy coding

Understood. Thank you so much. Didn’t expect such quick answer :slight_smile:

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.