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:
- Color is not an attribute of <BODY> tag and the color attribute is written as bgcolor.
- 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”>