Class 10 HTML Worksheet: The hr(Horizontal Rule) Tag

 Class 10 HTML Worksheet: The <hr> (Horizontal Rule) Tag



Part A: Fill in the Blanks

  1. The <hr> tag is used to create a __________ line across the webpage.
  2. The <hr> tag is often used to separate different __________ or sections of content.
  3. The <hr> tag is a __________ element, meaning it does not require a closing tag.
  4. The __________ and __________ attributes can be used to adjust the width and height of the horizontal rule.
  5. In modern HTML, the appearance of the <hr> tag is controlled using __________.

Part B: True or False

  1. The <hr> tag is used to create a vertical line. (True / False)
  2. The <hr> tag is used to define thematic breaks or divisions in content. (True / False)
  3. The color of the <hr> tag can be changed using CSS. (True / False)
  4. The <hr> tag requires a closing </hr> tag. (True / False)
  5. The width of the <hr> tag can be set as a percentage of the page width. (True / False)

Part C: Short Answer Questions

  1. What is the primary function of the <hr> tag in an HTML document?
  2. Write the HTML code to create a horizontal line with a width of 50% and height of 2 pixels.
  3. How can you use the <hr> tag to improve the readability of a webpage?
  4. Write the CSS code to style an <hr> tag with a blue color, 5px height, and dashed line style.
  5. How does the <hr> tag differ from the <br> (line break) tag in terms of functionality?

Part D: Practical Exercises

  1. Create an HTML document that displays the following content, separated by horizontal rules:

    • A heading that says "My Portfolio"
    • A paragraph describing your skills
    • Another heading that says "Projects"
    • A list of three projects you've worked on
  2. Write the HTML and CSS code to create a webpage with three horizontal rules:

    • The first one is 100% wide, 1px tall, and solid black.
    • The second one is 50% wide, 3px tall, and red in color.
    • The third one is 80% wide, 5px tall, and dashed.
  3. Write the HTML code to add a horizontal rule after each section of a webpage:

    • Section 1: "About Me"
    • Section 2: "My Hobbies"
    • Section 3: "Contact Information"

Part E: Code Correction

Examine the following HTML code and correct the mistakes related to the <hr> tag. Rewrite the correct code.

<!DOCTYPE html> <html> <head> <title>HR Example</title> </head> <body> <h1>Welcome to My Website</h1> <hr> <p>This is a paragraph.<hr></p> <hr width="50" height="3"> </body> </html>

Post a Comment

0 Comments