Student Assignment

Coding Class | Introduction to HTML and CSS

HTML and CSS Assignment

Study the questions carefully and write your answers in your exercise book.

Subject: Coding Topic: HTML and CSS

Instructions: Answer all questions. Write clearly and rewrite the required HTML code in your exercise book where instructed.

Question 1: Understanding HTML and CSS

Study the HTML and CSS code below and answer the questions that follow.

<!DOCTYPE html>
<html>
<head>
<style>
body {background-color: powderblue;}
h1   {color: blue;}
p    {color: red;}
</style>
</head>
<body>

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

</body>
</html>
  1. What is the meaning of HTML?
  2. What is the function of the <h1> tag?
  3. What is the function of the <p> tag?
  4. What is the purpose of the <style> tag?
  5. What is the background colour of the web page?

Question 2: Understanding CSS

Answer the following questions:

  1. Which CSS property is used to change the background colour of a web page?
  2. Which CSS property is used to change the colour of a heading?
  3. What colour is assigned to the heading in the given code?
  4. What colour is assigned to the paragraph in the given code?
  5. What is CSS, and what is its function in web development?

Question 3: Practical Application

Rewrite the HTML code in your exercise book and make the following changes:

  1. Change the background colour to yellow.
  2. Change the heading colour to green.
  3. Change the paragraph colour to black.
  4. Change the heading text to Welcome to My School.
  5. Change the paragraph text to I am learning HTML and CSS.

Remember to write the complete HTML code, including the opening and closing tags.

Submission Instructions