Skip to content
Exercises · Q11

Q.Write the HTML code for a complete web page whose browser-tab title is "My Page" and which displays a main heading "Welcome" and a paragraph of text. Name the purpose of the <head>, <title> and <body> tags.

ChseodishaTextbookSubjectiveImportance★★★★★est
79% · 11/14 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

Complete web page:

<!DOCTYPE html>
<html>
  <head>
    <title>My Page</title>
  </head>
  <body>
    <h1>Welcome</h1>
    <p>This is my web page.</p>
  </body>
</html>

Line-by-line explanation:

  • <!DOCTYPE html> tells the browser the document is HTML.
  • <html> ... </html> is the root element that wraps the entire page.
  • <head> ... </head> holds information about the page — such as its title — that is not displayed in the page area itself.
  • <title>My Page</title> sets the text shown on the browser tab / title bar.
  • <body> ... </body> holds everything the visitor actually sees.
  • <h1>Welcome</h1> is the main heading (the largest heading level).
  • <p>This is my web page.</p> is a paragraph of text. …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.