Question:

A web developer is creating a webpage where: 
• A heading is displayed at the top 
• A paragraph of text follows 
• A link is provided to navigate to another webpage
 Which of the following HTML code snippets correctly represents this structure?

Show Hint

Visible content = Body. Metadata/Scripts = Head. Link = A tag with HREF attribute. Always remember this separation.
Updated On: Jul 4, 2026
  • <head> < h1> Title </h1> </head> <body> Text <a href="page.html"> Link </a> </body>
  • <html> <h1> Title </h1> Text <a> Link </a> </html>
  • <html> <body> <h1> Title </h1> Text <a href="page.html"> Link </a> </body> </html>
  • <html> <title> Title </title> Text <link> page.html </link> </html>
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

Concept:
HTML (HyperText Markup Language) uses a specific nested tree structure. Visible content must be placed inside the <body> tag, and links require specific attributes to function.

Step 1:
Analyze the tag hierarchy.
A standard HTML document must start with <html> and contain a <body> section for all content displayed on the browser window.
Option A incorrectly places the <h1> (heading) inside the <head> tag. The <head> is for metadata (like the title that appears in the tab), not for visible headings.
Option B misses the <body> tag entirely and lacks the href attribute for the link.

Step 2:
Verify the requirements.
The developer needs:
Heading: <h1> Title </h1>
Paragraph: { Text
Link: <a href="..."> Link </a> All these must be wrapped in <body>.

Step 3:
Conclusion.
Option C follows the perfect semantic structure of HTML5. It opens the html and body tags, places the heading, paragraph, and anchor tag (with the necessary href attribute) in the correct order, and closes all tags properly.
Was this answer helpful?
0
0