HTML Part 2: Discussion on HTML, Types of Hyperlink and Horizontal Ruler

Get unlimited access to the best preparation resource for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Discussion on HTML

  • To Set Background Picture
  • Comment
  • Hyperlink
  • Horizontal Ruler
  • Font Tag

How to Set Background Picture?

To set background picture we use ‘background attribute’ of < body > tag

See the code:

< body background = “picture url” >

< /body >



What is Comment?

Comment is a non-executable code. It can be created in the HTML code for better understanding the content or for future reference. It does not display in the web page but remains in the coding.

How to Write Comment in HTML?


  • A Hyperlink is an element in Html that helps you to link a web page to another web page, any file, or some other portion of the same web page.
  • < a > anchor tag is used to create hyperlink.
  • A link can be any text or an image.
  • Hyperlinked text is displayed on a web page in blue colour.
  • Whenever you point that hyperlink, your mouse pointer will be changed to a hand symbol.

Example (See the Image) :

  • Code to create Hyperlink in HTML
  • < a href = “hyperlink reference” > Hyperlink Text < /a >

Types of Hyperlink

There are three types of Hyperlink in HTML:

  • Internal
  • External
  • Local

Internal Hyperlink: It will navigate the visitor to another web page of the same website.

Example:< a href = “home. html” > Click here to move to next page < /a >

External Hyperlink: It will navigate the visitor to another website on the internet.

Example:< a href = “” > Click here to open search engine < /a >

Local Hyperlink: It will navigate the visitor to another portion of the same web page.

Example:< a href = “bottom” > Click here to move to the bottom section of the web page < /a >

< p id = “bottom” > Copyright@hiitech20202 < /p >



Types of Hyperlink: Code/Output
Types of Hyperlink: Coding

Horizontal Ruler

  • A Horizontal Ruler is used to divide a web page into two sections or used to separate content on a web page. Horizontal Ruler can be created using < HR > tag.
  • < HR > tag is an empty or Singular tag.

Attributes of < HR > TAG

  • Size - defines the height of Horizontal Ruler
  • Color - defines the colour of Horizontal Ruler
  • Width - defines the width of Horizontal Ruler
  • Align - defines the alignment (position) of Horizontal Ruler. It can be left, center or right


< HR SIZE = “20” WIDTH = “50 %” COLOR = “RED” align = “center” >


Horizontal Ruler: Code/Output

Font Element

  • Font element < font > is used to apply formatting effects on Fonts.
  • Formatting Effects that you can apply like Font Color, Font Style, Font Effect or Font Size.

Attributes of Font Element

  • Size - defines the size of font. The maximum font size that can be displayed in browser is 7
  • Color - defines the color of font
  • Face - applies the font style (in-built) like “Times New Roman”


< font size = “6” face = “Monotype Corsiva” color = “red” >


Font Element: Coding


Font Element: Output


Q. 1 Which attribute of < body > tag is used to set the background picture of web page?

1. bgcolor

2. background

3. picture

4. image

Ans: 2. background

Q. 2 Which attribute of < font > tag is used to give the font style of the text on the web page?

1. color

2. font style

3. face

4. text

Ans: 3. face