SHARE
Facebook X Pinterest WhatsApp

So, You Want An HTML Declaration, Huh?

Written By
thumbnail
Joe Burns
Joe Burns
Jan 4, 2005

     If you’ve made your way through the HTML Goodies site, then you probably have looked at the source of some of my documents. I know some of you are looking because every now and again, I get a letter asking what that
strange, cryptic command right at the top stands for. If you don’t know what I mean, this is the command:


<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 3.2//EN”>



     That’s a strange looking thing, huh? It’s called an “HTML Declaration.” Basically it’s declaring what version of HTML the browser is to use when reading this document. It also tells the viewer, if they care to look. It’s long, but rather easy to understand. Here’s what it means:


  • !DOCTYPE HTML PUBLIC proclaims this is an HTML document type that can be read by public browsers.


  • -//W3C represents the HTML organization that denotes what HTML commands are to be used and what are not. You can visit their WWW page at http://www.w3.org and read about HTML until your brain is full.


  • //DTD HTML 3.2 stands for Document Type Description HyperText MarkUp Language (version) 3.2.


  • //EN means the document will be written in the English language.

     If you were attempting to write HTML using the commands set aside in HTML 4.0, then you would change the header above from 3.2 to 4.0. Now, I’m not talking browsers here. I am talking version of HTML. Again, if you’d like to read about new and older versions of HTML and what makes them different, go to http://www.w3.org. 4.0 is out and there are reams of paper on what it will do.

     My assumption is that once you read this, you will right away ask if you need to hurry and put the command on your pages. I don’t have a good answer for you there. I knew that would come up so I contacted my brain trust of HTML people. One said yes, one said no, the other said to do it if you remember. Not exactly the consensus of answers I was looking for.

     So, do you use it? Yes. I do on every page now. I started putting it on when I first learned about it. Some of my very early pages do not have the command and I’m in no real hurry to get it on them. Mainly because
the pages use very early, and very basic, commands that do not belong to a higher version of HTML. Besides, if you do not have a declaration, I’ve been told the default is the highest HTML version. I would not be doing myself any good by altering the page.

     I’ll give you a couple rules of thumb that one of the HTML big-heads told me. If you’re using META commands or plan to use HTML validators… use the declaration.

     …and of course, any comments regarding the use of these commands will be cheerfully accepted. If you know something I don’t, tell me. I’ll post it if I feel others should know.

 

Recommended for you...

Best JavaScript Frameworks & Libraries for Building Web Dashboards
Rob Gravelle
Jul 29, 2021
Google Web Vitals for Beginners
Diogo Souza
May 4, 2021
Web Site Maintainability
Vince Barnes
Jan 10, 2021
Getting Started with Grunt.js
Diogo Souza
Oct 8, 2018
HTML Goodies Logo

The original home of HTML tutorials. HTMLGoodies is a website dedicated to publishing tutorials that cover every aspect of being a web developer. We cover programming and web development tutorials on languages and technologies such as HTML, JavaScript, and CSS. In addition, our articles cover web frameworks like Angular and React.JS, as well as popular Content Management Systems (CMS) that include WordPress, Drupal, and Joomla. Website development platforms like Shopify, Squarespace, and Wix are also featured. Topics related to solid web design and Internet Marketing also find a home on HTMLGoodies, as we discuss UX/UI Design, Search Engine Optimization (SEO), and web dev best practices.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.