HTML query

Manish Goyal

Manish Goyal

@manish-r2Hoep Oct 21, 2024
Guys whenever i see the coding of any web page on a web Browser...I wondered why this line is written on start of any webpage...
why it is required...?Is it really necessary to write this?
<!DOCTYPE html PUBLIC "-//abc//DTD XHTML 1.0 Transitional//EN" "https://abc.com/TR/xhtml1/DTD/xhtml1-transitional.dtd">
😕😕

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Mahesh Dahale

    Mahesh Dahale

    @mahesh-E2tZ3t Dec 28, 2009

    !DOCTYPE is a top level tag that identifies which version of HTML or XHTML the document is using (called DTD).
    HTML and XHTML come in a variety of versions

    DTD stands for "Document Type Definition" and is a tool used by web browsers to determine what set of "rules" to use when reading the document. These "rules" are actually machine language that layout the legal structure,
    elements and attributes of a type of HTML or XHTML.
  • Manish Goyal

    Manish Goyal

    @manish-r2Hoep Dec 28, 2009

    mahesh_dahale
    !DOCTYPE is a top level tag that identifies which version of HTML or XHTML the document is using (called DTD).
    HTML and XHTML come in a variety of versions

    DTD stands for "Document Type Definition" and is a tool used by web browsers to determine what set of "rules" to use when reading the document. These "rules" are actually machine language that layout the legal structure,
    elements and attributes of a type of HTML or XHTML.
    Thanks Mahesh...
    But is it necessary to mention this?
    I mean ..I have also created website for my college..at that time i have not use this
    but there was no problem
    or it is standard?
  • Mahesh Dahale

    Mahesh Dahale

    @mahesh-E2tZ3t Dec 28, 2009

    Not having a Doctype will prevent a page from validating.
    Validated HTML is important for search engine indexing.
    When the !DOCTYPE tag is omitted most browsers will attempt to guess at which language the document was written in. When forced to guess at the !DOCTYPE, the browser will render pages much slower and often in error.
    If the !DOCTYPE cannot be determined by the browser, it will default into "quirks" mode parsing. Quirks mode parsing is more forgiving, but can often render code in a way not intended by the author.
  • Manish Goyal

    Manish Goyal

    @manish-r2Hoep Dec 28, 2009

    Thanks...mahesh..i