Home >> FAQs/Tutorials >> XHTML Tutorials and Tips >> Index

XHTML Tutorial - "meta" Elements Not Closed

By: FYIcenter.com

(Continued from previous topic...)

What Happens If a "meta" Element Is Not Closed?

Meta tags, link tags and base tags must be closed in XHTML documents. If you forget to close them like the HTML format, you will get validation errors. Try the following tutorial sample XHTML document on http://validator.w3.org/ to see what types of errors you will get:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
 <head>
  <title>My First XHTML Document</title>
  <base href="http://dev.fyicenter.com/" />
  <meta name="Author" content="FYIcenter.com">
  <meta http-equiv="Content-Type" content="text/html;
    charset=UTF-8" />
  <script type="text/javascript" src="_local.js"></script>
  <link rel="stylesheet" type="text/css" href="_fyi.css" />
 </head>
 <body>
 <p></p>
 </body>
</html>

You will get this error:

Error Line 8 column 46: end tag for "meta" omitted, 
  but OMITTAG NO was specified.
  <meta name="Author" content="FYIcenter.com">
You may have neglected to close an element, 
or perhaps you meant to "self-close" an element, 
that is, ending it with "/>" instead of ">". 

Note to HTML 4.0 authors, you must close meta elements in XHTML 1.0. This is the opposite of HTML 4.0, where you must not close meta elements.

(Continued on next topic...)

  1. What is the Top Level Structure of an XHTML Document?
  2. How Many Document Types Defined in XHTML 1.0?
  3. What Is the "html" Tag/Element?
  4. What is the Second Level Structure of an XHTML Document?
  5. What Is the "head" Tag/Element?
  6. What Is the "body" Tag/Element?
  7. How To Write a "head" Element Properly?
  8. What Is the "title" Tag/Element?
  9. What is a Smallest Valid XHTML Dodument?
  10. What Is Wrong with This "head" Element?
  11. What Happens If the "title" Element is Missing?
  12. What Happens If a "meta" Element Is Not Closed?
  13. What Is a "meta" Tag/Element?
  14. What Is the Description "meta" Tag/Element?
  15. What Is the Keywords "meta" Tag/Element?
  16. What Is the Robots "meta" Tag/Element?
  17. What Is a http-equiv "meta" Tag/Element?
  18. What Is the Author "meta" Tag/Element?
  19. What Is the "base" Tag/Element?
  20. What Is a "script" Tag/Element?
  21. What Is a "link" Tag/Element?
  22. What Is a "style" Tag/Element?


Selected Developer Jobs:

More...