Best Source of Web Development Tutorials, Articles, Programming Codes, Free PHP Scripts, PHP Tutorials and Much More
Login
Username:
Password:

Working with Fonts in HTML

Working with Fonts

By: programmersbank
<Font> tag is used for text formatting. It allows to adjust font color, font size and font name like arial, times new roman or verdana etc. The properties of font tags are:
  • SIZE : You can adjust font size using size properties. You can adjust size 1 to 7. Normal text size is 3.
  • COLOR: font color name or hex number of color Default color is black
  • FACE : the name of font (Arial, Verdana, Times New Roman), default font is Times New Roman
<html>
<head>
<title> Welcome to Programmersbank web page. </title>
</head>
<body>
<font face="arial" size="2" color="red">
Hello Dear I am a web page, my font is arial, size is 2 and color is red
</font>
</body>
<html>

Hello Dear I am a web page, my font is arial, size is 2 and color is red

Font Styles

Three tags are used in HTML for change font styles

  • <B> tag is used for Bold a text.
  • <I> tag is used for italic a text.
  • <U> tag is used for underline a text or line.

Here is the example of <B>, <I>, <U> tag:

<html>
<head>
<title> Welcome to Programmersbank web page. </title>
</head>
<body>
<B>This is a bold text</B><br>
<I>This is italic text</I><br>
<U>This is underline text</U><br>
</body>
<html>

Output

This is a bold text
This is italic text
This is underline text

Headings
Heading tags are used to define headings on your page. Headings are defined with the <h1> to <h6> tags. <h1> is the largest heading. <h6> is the smallest heading.
<h1>This is a h1 heading</h1>
<h2>This is a h2 heading</h2>
<h3>This is a h3 heading</h3>
<h4>This is a h4heading</h4>
<h5>This is a h5 heading</h5>
<h6>This is a h6 heading</h6>

The example of Heading tag:

<html>
<head>
<title> Welcome to Programmersbank web page. </title>
</head>
<body>
<h1>This is a h1 heading</h1>
<h2>This is a h2 heading</h2>
<h3>This is a h3 heading</h3>
<h4>This is a h4heading</h4>
<h5>This is a h5 heading</h5>
<h6>This is a h6 heading</h6>
</body>
<html>

This code will display following output:

This is a h1 heading

This is a h2 heading

This is a h3 heading

This is a h4heading

This is a h5 heading
This is a h6 heading

Tutorial Pages

Bookmark This Page