KnowledgeBoat Logo

Computer Applications

Identify the errors in the following HTML code and write the corrected code with each correction underlined.

<HTML>
<HEAD> IMAGES</TITLE>
<BODY BACKGROUND="Red">
<IMG HREF="abc.jpg">HERE IS MY IMAGE FILE
</HEAD> </HTML>

HTML Advanced Features

CBSE

2 Likes

Answer

The given HTML code has the following errors:

  1. The <HEAD> ... </HEAD tag must be placed above the <BODY> tag.
  2. The <TITLE> tag is missing its opening tag.
  3. The 'src' attribute of <IMG> tag should be used to define the image file to be displayed.
  4. <BODY> tag is not closed i.e., </BODY> tag is missing.

The correct HTML code is as follows:

<HTML>
<HEAD> 
<TITLE> IMAGES </TITLE>
</HEAD>
<BODY BACKGROUND = "Red">
<IMG SRC = "abc.jpg"> HERE IS MY IMAGE FILE
</BODY> 
</HTML>

Answered By

1 Like


Related Questions