banner



How To Set Font Size In Html

How to Change Font Size in Html

In HTML, we tin can modify the size of whatsoever text using the following different means:

  1. Using HTML tag
  2. Using an Inline fashion aspect
  3. Using internal CSS

Using HTML tag

Note: HTML v does not support the Size attribute of font, and so we have to use the inline fashion attribute and internal CSS options for irresolute the size of a text.

If we desire to change the size of a text using Html tag which is to be displayed on a web page, we take to follow the steps which are given below. Using these steps, we tin easily modify the size of whatsoever text:

Step 1: Firstly, we have to type the Html code in any text editor or open the existing Html file in the text editor in which we desire to use the Html tag for changing the font size.

Pace two: Now, move the cursor at the starting of that text whose size we want to alter. And then, type the Html <font> tag at that position.

Footstep iii: Then, we have to close the font tag at the end of the text whose size we want to modify.

Step 4: Now, we accept to add the aspect of the font tag whose name is "size". Then, type the Size attribute within the starting <font> tag. And, then nosotros have to give the size which we want to utilise on the text. We can give the value of size from 1 to 7. So, type the number in the Size attribute as described in the following block.

Footstep 5: And, at concluding, we take to salve the Html lawmaking in the text editor and run the code. After executing, we volition see the output in the browser. The following screenshot shows the output of the higher up Html Code:

How to Change Font Size in Html

Using an Inline Style attribute

If we want to modify the size of a text using an inline style attribute which is to be displayed on a web page, we take to follow the steps which are given below. Using these steps, we tin easily alter the text size.

Step 1: Firstly, we take to type the Html code in any text editor or open the existing Html file in the text editor in which we want to use the style attribute for irresolute the size of a text.

Step two: Now, place the cursor at the starting of that text whose size nosotros want to change. And so, type the inline style attribute within any element. Here, we use the <p> (paragraph) tag:

Step 3: In this step, we have to requite the size. Then, type the size in the font-size belongings of the fashion attribute.

Step 4: Then, nosotros have to shut the chemical element at the end of the text whose size nosotros want to change.

Stride v: And, at last, save the Html code which changes the text/font size using the CSS style attribute.

Test it Now

The output of the higher up lawmaking is shown in the post-obit screenshot:

How to Change Font Size in Html

Using Internal CSS

If we want to change the text or font size using an internal cascading stylesheet which is to exist displayed on a web page, we have to follow the steps which are given below. Using these steps, we can easily modify the size of any text.

Step 1: Firstly, nosotros accept to type the Html lawmaking in whatsoever text editor or open the existing Html file in the text editor in which we desire to utilize the internal CSS for changing the size of a text.

Step two: At present, nosotros have to place the cursor in the head tag of the Html document so define the styles inside the <style> tag as shown in the following cake. And, then type the font-size aspect into the chemical element selector.

Stride 3: At present, we take to type the defined element selector before the text whose size nosotros want to change.

Test information technology Now

The output of the above code is shown in the post-obit screenshot:

How to Change Font Size in Html

How To Set Font Size In Html,

Source: https://www.javatpoint.com/how-to-change-font-size-in-html

Posted by: watkinsposiciente.blogspot.com

0 Response to "How To Set Font Size In Html"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel