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

Get unlimited access to the best preparation resource for UGC : Get detailed illustrated notes covering entire syllabus: point-by-point for high retention.

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>

Code/Output

Code/Output

Code/Output

Loading image
Code/Output

Code/Output

Loading image

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?

<! --- comment for reference ----->

Hyperlink

  • 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= “www.google.com”>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>

Code/Output

Coding

Types of Hyperlink: Code/Output

Types of Hyperlink: Code/Output

Loading image
Types of Hyperlink: Coding

Types of Hyperlink: Coding

Loading image

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

HTML Code

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

Code/Output

Horizontal Ruler: Code/Output

Horizontal Ruler: Code/Output

Loading image

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”

HTML Code

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

Coding

Font Element: Coding

Font Element: Coding

Loading image

Output

Font Element: Output

Font Element: Output

Loading image

MCQ

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