This is the <sub>SubScript</sub> text.
Superscript Tag: Used to define superscript text. Tags that are used to define superscript are..This is the <sup>SuperScript</sup> text.
Building upon our understanding of the <sub> and <sup> tags, let's explore additional applications and customization techniques to enhance our web content.
While the default rendering of <sub> and <sup> tags may suffice, we can further refine their appearance using CSS. This allows us to control aspects like vertical alignment and font size for a more cohesive design.
<style>
sub {
vertical-align: sub;
font-size: 0.8em;
}
sup {
vertical-align: super;
font-size: 0.8em;
}</style>
In this example, we adjust the vertical alignment and font size of the subscript and superscript text to ensure they blend seamlessly with the surrounding content.
There are scenarios where combining both subscript and superscript is necessary, such as in mathematical expressions or scientific notations.
The variable x12 denotes...
<p>The variable x<sub>1<sup>2</sup></sub> denotes...</p>
Here, the superscript '2' is applied to the subscript '1' of variable 'x', demonstrating nested usage.
Ensuring that subscript and superscript text is accessible is crucial for all users, including those using screen readers.
The chemical formula for water is H2O.
<p>The chemical formula for water is <sub aria-label="subscript">H<sub>2</sub>O</sub>.</p>
Adding ARIA labels helps assistive technologies interpret and read the text correctly.
02-12-2020 | |
VERY NICE |