HTML: Code validation (2024)

You can make sure that your code is correct by having it validated. Thereare various sites that will do this for free.Many browsers will accept incorrect code, and guess a way to interpret it.Different browsers might reach different conclusions.

Moreover, at some point in the future it could happen that your code is notrecognized anymore, or produces an outcome different from what youintended.
[On the other hand, browsers will - in general - understand correct codefrom a previous version.]

In general, you add at the beginning of your HTML file (before any HTMLcode) the lines
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
and then submit it to a validation site.

Here are the details.

  • You have to describe the encoding used (some validating sitesguess it, or give you a choice).

    One way is to do it before the HTML code. The next line takes care of thecommon choice of characters, ISO 8859-1, (Latin-1):

    <?xml version="1.0" encoding="iso-8859-1"?>

    Alternatively, add in the <head>...</head> part ofthe HTML code the line (note the use of quotation marks - it is not a typo)

    <meta http-equiv="Content-Type"content="text/html; charset=iso-8859-1">
  • In order to validate your code, you have to declare thestandard to which it adheres.
    To describe the HTML standard (the document type declaration,DTD), the file should contain a DOCTYPE declaration (before theHTML code).

    Here are a few examples (from http://www.htmlhelp.com/tools/validator/doctype.html).
    The information about the URL against which to check the file need not beprovided.

    • HTML 4.01 Transitional:
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01Transitional//EN">
      or
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01Transitional//EN"
      "http://www.w3.org/TR/html4/loose.dtd">
    • HTML 4.1 Frameset:
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
      "http://www.w3.org/TR/html4/frameset.dtd">
    • HTML 4.0 Strict:
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
      "http://www.w3.org/TR/REC-html40/strict.dtd">
    • HTML 3.2:
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2Final//ENC">
  • Then, you submit your file to a validator (either on the Internet, oron your machine.)
The Web DesignGroup's validator is at http://www.htmlhelp.com/tools/.
It can validate HTML and CSS1 (Cascading Style Sheets, version 1).
The CSS validator does not seem to like CSS included in an HTML file.
Help is also available.

The World Wide WebConsortium's validation site is http://validator.w3.org/.
This site offers validation of Cascading Style Sheets (CSS) as well.
To see what it does (and why), look at http://validator.w3.org/docs/help.html.

HTML: Code validation (2024)
Top Articles
The Importance of Blogging for your website
Married Woman’s Mother Embarrasses Her New Husband By Talking About Her Ex Who Is Wealthier Than Him
Promotional Code For Spades Royale
Vaya Timeclock
Crocodile Tears - Quest
Triumph Speed Twin 2025 e Speed Twin RS, nelle concessionarie da gennaio 2025 - News - Moto.it
Sissy Hypno Gif
Naturalization Ceremonies Can I Pick Up Citizenship Certificate Before Ceremony
Bluegabe Girlfriend
The Powers Below Drop Rate
Apnetv.con
Cvs Devoted Catalog
Infinite Campus Parent Portal Hall County
Full Range 10 Bar Selection Box
Facebook Marketplace Charlottesville
David Turner Evangelist Net Worth
Craigslist Pets Longview Tx
Buff Cookie Only Fans
Apne Tv Co Com
Nissan Rogue Tire Size
Aucklanders brace for gales, hail, cold temperatures, possible blackouts; snow falls in Chch
Keck Healthstream
Ratchet & Clank Future: Tools of Destruction
Satisfactory: How to Make Efficient Factories (Tips, Tricks, & Strategies)
Acts 16 Nkjv
Toyota Camry Hybrid Long Term Review: A Big Luxury Sedan With Hatchback Efficiency
Quick Answer: When Is The Zellwood Corn Festival - BikeHike
Seeking Arrangements Boston
Sadie Sink Reveals She Struggles With Imposter Syndrome
Creed 3 Showtimes Near Island 16 Cinema De Lux
Aes Salt Lake City Showdown
TJ Maxx‘s Top 12 Competitors: An Expert Analysis - Marketing Scoop
Delta Math Login With Google
Core Relief Texas
Storelink Afs
Craigslist West Seneca
Pawn Shop Open Now
World History Kazwire
WorldAccount | Data Protection
Samantha Lyne Wikipedia
Aita For Announcing My Pregnancy At My Sil Wedding
The Listings Project New York
Lucifer Morningstar Wiki
My Gsu Portal
Kaamel Hasaun Wikipedia
Leland Westerlund
Colin Donnell Lpsg
Richard Mccroskey Crime Scene Photos
Diamond Desires Nyc
Craigslist.raleigh
Electronics coupons, offers & promotions | The Los Angeles Times
Latest Posts
Article information

Author: Duane Harber

Last Updated:

Views: 6440

Rating: 4 / 5 (51 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Duane Harber

Birthday: 1999-10-17

Address: Apt. 404 9899 Magnolia Roads, Port Royceville, ID 78186

Phone: +186911129794335

Job: Human Hospitality Planner

Hobby: Listening to music, Orienteering, Knapping, Dance, Mountain biking, Fishing, Pottery

Introduction: My name is Duane Harber, I am a modern, clever, handsome, fair, agreeable, inexpensive, beautiful person who loves writing and wants to share my knowledge and understanding with you.