How to change the font size in CSS?26 Mar 2025 | 2 min read Similar questions
The font-size property in CSS affects the size of the text of an element. It is used to specify the height and size of the font. The default value of this property is medium and can be applied to every element. The values of this property are xx-small, small, x-small, etc. This property has numerous values that are responsible for changing the size of the content. There is the length value that can be in cm, px, pt, etc. Negative values of length are not allowed in font-size. NOTE: If we do not define a font-size, then for the normal text such as paragraph, the default size is 16px, which is equal to 1em.The font-size can be absolute or relative. The absolute size sets the text to a definite size, whereas the relative size sets the text relative to the neighboring elements. SyntaxLet's understand how to change the size of font by using some illustrations. Example - Using font-size valuesOutput ![]() Example - Using length valueIn this example, we are using the length value with em, vw, px, and cm. Output ![]() Next TopicHow to change image size in CSS |
? In this article, we will learn how to put an icon inside an input element in a form using CSS with the help of various examples. To put an icon inside an input element for this, we are used the <i> tag and the <span> tag with...
7 min read
In this article, we will create a CSS shake effect on text and image. In the beginning, we will learn the basic meaning of CSS. After that, we will learn this concept with the help of various examples. What do you mean by CSS? The term CSS stands...
7 min read
? A grid can be defined as an intersecting set of vertical and horizontal lines. CSS Grid layout separates a page into major sections. Grid property offers a grid-based layout system having rows and columns. It makes the designing of web pages easy without positioning and...
3 min read
The border color is a CSS property that is used to apply color to the border of an HTML element. The color between the padding and the margin of an HTML element is called the border color. It is important to know that to use the border-color...
11 min read
? Sometimes, it is required to fit an image into a certain given dimension. We can resize the image by specifying the width and height of an image. A common solution is to use the max-width: 100%; and height: auto; so that large images do not...
2 min read
Vertical Align in CSS In CSS, the vertical-align property controls the vertical alignment of inline-level elements or table cells within their containing element. It applies to elements that are part of a line of text or are displayed as inline-block or table-cell. The "vertical-align" property is commonly...
9 min read
? CSS is used for defining the styles for web pages. It describes the look and formatting of a document which is written in a markup language. It provides an additional feature to HTML. It is generally used with HTML to change the style of web pages...
2 min read
The abbreviated term CSS refers to Cascading Style Sheets. Managing the appearance and layout of HTML (Hypertext Markup Language) documents is a key technique in web development. CSS enables web designers to apply styles to HTML components, giving websites their visual look. Styles include colors, fonts,...
4 min read
? In this article, we will learn how to change the color of the PNG image using CSS with the help of various examples. A PNG image is a transparent image. We can change the color of PNG image using following CSS styles: filter: none | blur() | brightness()...
7 min read
CSS (Cascading Style Sheets) is a language used to describe a document's presentation and formatting in HTML or XML. It allows web developers to control the appearance of elements on a web page. Here are some commonly used CSS properties. A CSS property styles an aspect...
14 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