CSS Superscript and Subscript26 Mar 2025 | 2 min read In HTML, there is the use of <sub> and <sup> tags to define the subscript and superscript text. The superscript text appears in a smaller font and the half character above the normal line. It is generally used to write mathematical equations (like x2 + y2 = r2), footnotes, and many more. Unlike superscript, the subscript text appears in a smaller font and the half character below the normal line. It is generally used to write chemical equations or chemical formulas such as H2O, H2SO4, etc. In CSS, the vertical-align property is used to achieve the same thing. We can specify the superscript and subscript of text using CSS as well. This CSS property specifies the vertical alignment of the text. Now, let's see how to achieve the superscript and subscript using the vertical-align property. SyntaxProperty valuesbaseline: It is the default value that aligns the text to the baseline of the parent element. super: It is the superscript that raises the text. sub: It is the subscript that lowers the text. When the values super and sub of this property are applied, then the text becomes superscript or subscript. Example- SuperscriptExample- SubscriptNext TopicCSS Text Effects |
Introduction Opacity and transparency are the two sides of the coin. Both are used for designing the website. With the help of those, we can create contrast and reinforce a brand's identity. There are many web designing techniques available in CSS. Out of those, we use...
7 min read
CSS card design is most important for a user-friendly method of presenting information in an organized style. The card is used to become an essential component of contemporary web design. It works from straightforward, basic designs to more complex, dynamic card design layouts. We can design exciting...
6 min read
Cascading Style Sheets (CSS) is the language used to style the visual presentation of web pages. It allows developers to control layout, colours, fonts, and other design elements. One powerful property in CSS is position, which enables precise control over the positioning of elements on a...
4 min read
Introduction The textual links are colored and highlighted to provide perceptual attention, like most paintings are framed to enhance their look and for decorating reasons. The HTML/CSS standards specify that clicked hyperlinks be underlined by default. This promotes clickability and engagement with web pages and serves various...
5 min read
property This CSS property specifies whether or not an element shows some action when the pointer event is triggered upon it. The pointer-events are triggered by touch, stylus, mouse click, and many more. The pointer-events property controls how the HTML elements respond to events such as...
2 min read
property This CSS property is used to specify the alignment of the content within the container. It is used with the object-fit property to describe how an element like <video> or <img> is positioned with x/y coordinates within its container. When using the object-fit property, the...
2 min read
CSS Sticky The CSS position property sets the position for an HTML element. It is also used to place an item behind another element and is useful for the scripted animation effect. The "position: sticky;" is used to position the element based on the user's scroll position. This...
8 min read
In today's world, you hardly have any opportunity to be heard or noticed a second time in the virtual world, where the canvas of creativity is never complete. As a web designer/developer, you sell out designing artistically attractive and fun sites. Using CSS animation keyframes can...
9 min read
CSS Transform Origin This CSS property is used to change the position of transformed elements. It is a point around which the transformation is applied. It establishes the origin of the transformation of an element. It can be applied to both 2D and 3D rotations. The transform-origin...
21 min read
CSS selectors are utilized to select the HTML elements, which helps in applying styles to the elements. Many selectors in CSS help in selecting the HTML elements. Some of the selectors are used to specify the relationship between two elements, which are called CSS combinators. The...
15 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India