Identify the error HTML code.

Q2. Identify the error(s) in the following HTML code. Also write the correct code.

<BODY Color=”Red” background=”School.jpg”>

Ans. The errors in the given code are:

  1. Color is not an attribute of <BODY> tag and the color attribute is written as bgcolor.
  2. Bgcolor and background attributes should not be written together. Because the background attribute overrides the effect of bgcolor attribute.

The correct code is:

 <BODY background =”School.jpg”>

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: