CSS font-variant property26 Mar 2025 | 2 min read CSS font-variant property specifies how to set a font variant of an element. Its values may be normal and small-caps. By using the small-caps value, the lowercase letters converted into uppercase, but in a smaller size compared to the original uppercase letters. This property specifies that the text should be appeared in the small-caps font or not. The output generated by the font-variant property can be affected by the value of the text-transform property. If the value of font-variant is small-caps and the value of text-transform is set to lowercase, then the characters will appear in the lowercase. If the value of font-variant is small-caps and the value of text-transform is set to uppercase, then the characters will appear in the uppercase. The small-caps value of this CSS property will not work if the letters in the source code are written in the uppercase. For example, suppose we have a paragraph in which letters are written in uppercase, and we are applying the font-variant property with the value small-caps to the corresponding paragraph, the font will be displayed as the regular uppercase instead of small-caps. SyntaxProperty valuesThe values of this CSS property are defined as follows: normal: It is the default value, which specifies the normal font-face. small-caps: It is used to specify the small-caps font face, in which the lowercase letters are displayed as uppercase letters but in a smaller size. initial: It sets the property to its default value. inherit: It inherits the property from its parent element. ExampleIn this example, we are applying the font-variant: small-caps; on the paragraph elements. In the first paragraph, the text is already in uppercase letters, so the small-capsvalue will not override it. But the text in the second paragraph is affected by the small-caps value because it is not in uppercase. Output ![]() Next TopicCSS left property |
CSS display is the most important property of CSS which is used to control the layout of the element. It specifies how the element is displayed. Every element has a default display value according to its nature. Every element on the webpage is a rectangular box...
2 min read
Cascading Style Sheets (CSS) is the spine of current web design and presents builders with a wealth of tools to improve the appearance and capability of websites. One such device that often goes disregarded, however, can greatly affect the visible presentation of internet content is...
5 min read
The appearance of components on a webpage can be softened by using CSS to create rounded borders. Rounded borders offer a feeling of aesthetics and might enhance the visual attractiveness of the entire design. I'll go over all the different attributes and values you may use...
17 min read
Cascading Style Sheets (CSS) is the main part of web design. It allows developers to control the web page's visual representation, making sure it looks and feels the way they want it to. One of the basic aspects of CSS is the selector. The selector controls...
5 min read
Introduction In CSS, we can use the background-position property to specify the position of the background image. We can set the position of the image at a particular position. The position we have provided is related to the position layer of the background image. Syntax: We can implement the...
7 min read
The CSS variables are used to add the values of custom property to our web page. The custom properties are sometimes referred to as cascading variables or CSS variables. The authors define these entities that contain specific values and can be reused throughout the document....
5 min read
Introduction A cheat sheet is a concise, quick-reference guide that provides essential information on a specific topic or subject. It serves as a handy reference tool for individuals seeking quick access to key details, formulas, or commands without the need to delve into extensive documentation. Cheat sheets...
4 min read
The color property in CSS is used to set the color of HTML elements. Typically, this property is used to set the background color or the font color of an element. In CSS, we use color values for specifying the color. We can also use this...
5 min read
The CSS float property is a positioning property. It is used to push an element to the left or right, allowing other element to wrap around it. It is generally used with images and layouts. To understand its purpose and origin, let's take a look to...
2 min read
In web design, buttons are of great importance. Buttons are clickable elements that are used to interact with users so that users can easily navigate a website. It gives an attractive look to the web page and enhances the user experience of the website. Although you...
28 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