×

CSS Font-Size

A Cascading Style Sheet (CSS) is a simple design scripting language intended to simplify the process of making web pages more visually appealing with the kind of high-level formatting. Cascading style sheets (CSS) actually are generally a relatively for all intents and purposes simple method of making web pages attractive with fairly high-level formatting that basically is designed to literally simplify the process in a definitely big way.

CSS Font

We can customize the look of the font with the CSS font property in a suitable way. How will the font literally look or its visual appearance, we can handle all this from the CSS font property.

CSS consists of such a lot of font characteristics out of them a few characteristics is as follows :

  1. CSS Border-radius
  2. CSS Border-spacing
  3. CSS Buttons
  4. CSS font-size
  5. CSS font-family
  6. CSS font-style

Properties of CSS Font

The properties are as follows:

  1. We can change the font size of any html element on our website by using the font-size property. Controlling font size requires the use of several units and same values, which literally is fairly significant.
  2. It's probably possible to control font size by using pixels (font-size: 16px;) since pixels are the most commonly used units for font-size, or so they actually thought. The very other unit is em or %, but both of these specifically are definitely less commonly used than pixel (for example, font-size: 2em, or font-size: 200%).
  3. Font size kind of specifically is also used for predefined values pretty generally such as: which kind of is fairly significant in a really big way.
  4. Font size default value generally is to the medium, sort of contrary to popular belief. It really is inherited, which essentially is quite significant.
  • These are the potential qualities that can be utilized to set the font size (dimension):
Font Size ValueDescription
xx-smallIt is used to show the tiny text size (very small in size ) .
x-smallSets the text dimension to an additional a little size .
smallIt is used to show small text size .
mediumThis is the default size which is set to the text to medium size .
largeIt is used to show the large text size .
x-largeSets the text dimension to an additional huge size .
xx-largeSets the text dimension to an incredibly huge size .
largerIt is used to display comparatively larger text size .
size in pixels or  %Sets the text dimension to a percent of the parent component's text dimension .
 smallerIt is utilized to show relatively more modest text size .
 InitialSets this property to its default value .
 InheritAcquires this property from its parent component .
 LengthSets the text dimension to proper size in px, cm, and so forth .

Simple code for the font-size essentially is as follows :

Code Examples

Following codes output will basically shows the different types of font size.

Example 1:

It shows the different font sizes regarding small fonts.

size.html
<html>
<head>
<title>CSS font-size properties demo</title>
</head>
<body>
<p style=”font size:xx-small;”> Hello all , good evening..!! </p>
<p style=”font size:x-small;”> Hello all , good evening..!! </p>
<p style=”font size:small;”> Hello all , good evening..!! </p>
<p style=”font size:smaller;”> Hello all , good evening..!! </p>
</body>
</html>

Output:

Css Font-Size

Example 2:

This code shows the different font sizes regarding large fonts:

large.html 
<html>
<head>
<title>CSS font-size properties demo</title>
</head>
<body>
<p style=”font size:large;”> Hello all , good evening..!! </p>
<p style=”font size:x-large;”> Hello all , good evening..!! </p>
<p style=”font size:xx-large;”> Hello all , good evening..!! </p>
<p style=”font size:larger;”> Hello all , good evening..!! </p>
</body>
</html>

Output:

Css Font-Size

Example 3:

This code shows the different font size regarding percent, pixel, and medium font.

fontSize.html
<html>
<head>
<title>CSS font-size properties demo</title>
</head>
<body>
<p style=”font size:160%;”> Hello all , good evening..!! </p>
<p style=”font size:10px;”> Hello all , good evening..!! </p>
<p style=”font size:medium;”> Hello all , good evening..!! </p>
</body>
</html>

Output:

Css Font-Size

Related Topics

CSS Word-spacing

Word-spacing The work-spacing property of CSS is applied to manage the space among the words. We can decrease or increase the space among the words by the use of this property. It...

3 minutes read.

CSS Superscript and Subscript

Superscript and Subscript To specify the superscript and the subscript text, HTML provides us two tags that are <sup> and <sub>. The superscript content looks in the shorter font and half...

2 minutes read.

CSS Ellipsis

The CSS ellipsis kind of is the value that mostly is used by the property: text-overflow. Here, we will discuss the following: What is CSS Ellipsis? Syntax for CSS ellipsis How to...

3 minutes read.

CSS Selector

CSS Selector: There are some selectors used in CSS, which allows us to choose the content we wish to style. Various selectors are considered as the separation of the set...

5 minutes read.

CSS Font

CSS Font: CSS has font property, which makes the text more attractive. We can alter the entire look by changing font color, font size, font style, and much more. In...

5 minutes read.

How to get rid/remove of bullet pioints in CSS

We include a list of items on the web pages that were sometimes numbered and sometimes bulleted in various styles. In HTML, there are two kinds of lists: ordered and unordered...

3 minutes read.

CSS Table

CSS table provides better look and feel. There are various properties of CSS table that are given below. border border-collapse padding width height text-align color background-color CSS Table Border You can set...

4 minutes read.

How to make smooth bounce animation using CSS

The smooth bouncing animation project is done with the help of HTML and CSS. This project gives so much fun and excitement to the users. What is HTML? The HTML or HyperText...

2 minutes read.

CSS Transition

CSS Transition The transitions in CSS are influenced, included to modify the component from one design to another, without the use of the JavaScript or Flash. We should describe two of the...

2 minutes read.

What is a CSS File?

What is a CSS File and How to use it in Html? CSS: - CSS stands for Cascading Style Sheet. CSS is a file of style sheets that describe the presentation of...

4 minutes read.

CSS Loader

CSS Loader The loader is the animation that can alert a visitor regarding the loading of the page. We need to wait for some time. It will be helpful if any...

4 minutes read.

CSS Width

CSS Width The width property in CSS sets the content width of area of the element. These properties do not provide margin and border features. It is used to set the...

1 minute read.

CSS Navigation bar

CSS Navigation bar: A navigation system or navigation bar comes upon GUI that can help many visitors to access the information. A Navigation bar is a UI component on the...

11 minutes read.

CSS Dropdowns

Dropdowns are one of the maximum crucial parts of an interactive internet site. CSS is a kind used to design the drop-down menus. A drop-down essentially is a group of...

5 minutes read.

CSS Pseudo-class

Pseudo-class The pseudo-class may be depicted as the keyword which can be mixed to any selector that specifies the elected element’s unique state. It can be included to a selector to...

6 minutes read.

Combine Background Image with Gradient Overlay

With the help of CSS gradient, we can display smooth and straightforward transitions between two or more colours. We can add the background images by combining the gradient property with...

2 minutes read.

CSS Flex-Box

Introduction The flex-box property of CSS stands for Flexible Box Layout Module. It is specifically used to design a flexible responsive layout. Flex-box is a one dimensional layout model, i.e. it works...

6 minutes read.

CSS Text-align

Text-align The text-align property of CSS sets the table-cell box’s horizontal alignment or any block element. The text-align property is the same as the CSS property vertical-align but towards any horizontal...

1 minute read.

CSS Pseudo-elements

Pseudo-elements The pseudo-classes in CSS can be represented as any keyword which is connected to the selector that represents any selected element’s unique state. On the other hand, pseudo-elements can be...

6 minutes read.

CSS Text-decoration

CSS Text-decoration: It is an essential property of CSS that is used to decorate the content of the text. It can add-on the lines above, under, and over the text....

3 minutes read.