DEV Community

swetha palani
swetha palani

Posted on

day 1 plan medium level question

  1. Q: What are self-closing tags in HTML?
    A: Tags that do not have a separate closing tag, used for elements without content.
    Examples: img, br, hr, input, meta

  2. Q: Difference between HTML Tags and HTML Elements
    A:

  • Tag: Code in < >, e.g.,

    or

  • Element: Complete structure with start tag, content, and end tag, e.g.,

    Hello

  1. Q: Difference between id and class attributes A:
  • id: Unique, identifies one element, e.g.,
  • class: Can be used for many elements, e.g.,

  1. Q: Difference between , , A:
  • – Thematic section, e.g.,

    About

  • – Standalone content, e.g.,

    Blog

  • – Sidebar/related content, e.g.,

    Links

  1. Q: Purpose of tag
    A: Provides metadata about the page, placed in

    . Examples: ,
  2. Q: Explain this HTML code:

html
<!DOCTYPE html>




Document


A:

  • <!DOCTYPE html> – HTML5 declaration
  • – Root element with language English
  • – Metadata section
  • – Character encoding
  • – Mobile responsive
  • – Browser tab title
  • – Visible content section
  1. Q: Difference between ,

    ,

    A:
  • – Page title in browser tab
  • – Main heading of page

  • – Top section of page, can contain headings/nav

Top comments (0)