Line Break <br> Tag
The <br> empty Tag is used for line break from specific position of the text.
Example
<!DOCTYPE html> <html> <head> <title>Superscript Example</title> </head> <body> This is line break contents of the web page.<br>This is line break contents of the web page. </body> </html>
Output
This is line break contents of the web page.
This is line break contents of the web page.
Horizontal Rule <hr> Tag
The <hr> Tag represents a thematic break between paragraph level elements. We use size, color and width attributes with it.
Example
<!DOCTYPE html> <html> <head> <title>Horzontal Rule Example</title> </head> <body> <p align="center"> <h2>The Heading element of the web page with <hr> Tag.</h2> <hr width="35%" color="#ff0000" size="4"/> </p> </body> </html>
Output
The Heading element
Font <font> Tag
<font> tag allows us to set or change size, color and type of the text font. This tag is having three attributes called size, color, and face to customize our fonts.
Set Font Size
We can set text font size using size attribute. The range of font size values is from 1(smallest) to 7(largest). The default size of a font is 3.
Example:
<!DOCTYPE html> <html> <head> <title>Font Size Example</title> </head> <body> <font size = "1">Font size = "1"</font><br /> <font size = "2">Font size = "2"</font><br /> <font size = "3">Font size = "3"</font><br /> <font size = "4">Font size = "4"</font><br /> <font size = "5">Font size = "5"</font><br /> <font size = "6">Font size = "6"</font><br /> <font size = "7">Font size = "7"</font> </body> </html>
Output
Font size = "1"
Font size = "2"
Font size = "3"
Font size = "4"
Font size = "5"
Font size = "6"
Font size = "7"
We can set font face using face attribute, if the user viewing the page doesn't have the font installed, they will not be able to see it. For this reason user will see the default font face applicable to the user's compute.
Example
<!DOCTYPE html> <html> <head> <title>Font Face Example</title> </head> <body> <font face = "Times New Roman" size = "5">Times New Roman</font><br /> <font face = "Verdana" size = "5">Verdana</font><br /> <font face = "Comic sans MS" size =" 5">Comic Sans MS</font><br /> </body> </html>
Output
Times New Roman
Verdana
Comic Sans MS
Italic Text <i>
If we want to display any text in italicized then we use text enclosed with <i>...</i>.
Example
<!DOCTYPE html> <html> <head> <title>Italic Text Example</title> </head> <body> <p> HTML stands for <i>Hyper Text Markup Language</i></p> </body> </html>
We can also use two or more font face alternatives by listing the font face names, separated by a comma.
<font face = "Verdana,Comic sans MS"> <font face = "Arial,Verdana,Comic sans MS">
Setting Font Color
We can set any font color you like using color attribute. You can specify the color that you want by either the color name or hexadecimal code for that color.
Color Name | Hex Value | Color |
---|---|---|
aqua | #00ffff | |
black | #000000 | |
blue | #0000ff | |
fuchsia | #ff00ff | |
green | #008000 | |
gray | #808080 | |
lime | #00ff00 | |
maroon | #800000 | |
navy | #000080 | |
olive | #808000 | |
purple | #800080 | |
red | #ff0000 | |
silver | #c0c0c0 | |
teal | #008080 | |
white | #ffffff | |
yellow | #ffff00 |
Example
<!DOCTYPE html> <html> <head> <title>Setting Font Color Example</title> </head> <body> <font color = "#000080">This text is in navy</font><br /> <font color = "red">This text is red</font> </body> </html>
Output
This text is in navy
This text is red
0 Comments