Hi everyone! I'm the author of code.mu :)
I'd love to chat with my non-Russian audience. I'm looking for your feedback on the site and the translation quality. Let's chat:)
91 of 133 menu

The doctype tag

The doctype tag tells the browser the HTML version. To specify the current, fifth version of HTML, you should write it like this:

<!DOCTYPE html>

Before HTML5 came out, you had to write scary things that were completely impossible to remember by heart. For example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

Fortunately, doctype has been shortened and such long constructions are no longer needed. There is no need to remember them, let alone understand what they did.

The doctype tag is written at the very beginning of the document, before the html tag. The tag is mandatory, but the page will work without it, but in this case some things will work differently than with doctype. Therefore, always write it - you will avoid some problems.

Example

Let's look at the structure of the simplest HTML page:

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>This is the title title</title> </head> <body> This is the main content of the page. </body> </html>

See also

  • tag html,
    which is the main tag on the page
  • tag head,
    which contains service information
  • tag body,
    which contains the main content
  • tag title,
    which contains the page title
  • tag meta,
    which contains meta data
English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline