Using BBEdit Syntax Check - Instructor: Nadine Wettlaufer

(this information may or may not apply to other syntax checkers)

  1. You must start your page with the correct DOCTYPE, or any syntax check you do will not be useful.
    Please use HTML5 syntax for pages in this course.

  2. Ideally, to get the best use out of the Syntax Check, you also need to try to follow standard practices around Block-Level tags and Inline tags. Read HTML: Block-Level tags versus Inline tags for more information.

  3. In the HTML Tool Palette, click on the Check Syntax button:

  4. Either you will get "No Errors" or you will get a few errors listed in a window. Look near the top left of the window to see how many errors BBEdit thinks there are.

  5. Starting with the first error listed, read what BBEdit thinks the error is. Often BBEdit is correct, but not always. Remember, BBEdit will call tags "elements".

  6. If you've got an idea of what BBEdit thinks the error is, go to the error and try to fix it:

    TO GO TO AN ERROR IN ORDER TO FIX IT: double-click on the error in the BBEdit syntax check error window.

  7. Your actual, editable HTML page window will come to the front (in front of the syntax error window), with some tags selected near where BBEdit thinks the error is.

  8. Fix the syntax error in your HTML (try to, anyway). Sometimes the error is actually located right before where BBEdit thinks it is located.

  9. Save the change.

  10. Click on the Check Syntax... button again, and see if the number of errors has decreased.

  11. Keep working your way through errors on the page using the above methods until you get a result of "No Errors". Make sure to save the final version of the page.

  12. REMEMBER: if you make any changes to your page after doing the syntax check, you should check the page again, to make sure you haven't accidentally created any new errors.

Two more things to keep in mind:

  1. Remember that one syntax error can actually cause a cascade of many supposed syntax errors immediately after the one actual problem. I say supposed because these errors may not be actual errors, they may just seem that way to BBEdit because of the one actual syntax error that exists.

    Because of this, fixing one error often clears up several others that BBEdit was also listing. For example, you may have 12 errors, fix one of them, and find that BBEdit now lists only 8 errors left.

  2. When you are dealing with block-level tag and inline tag rules, sometimes you will get an error message like this:
          (remember, element is just another word for tag)
    It may seem confusing at first, but what is it essentially saying?
    It's saying that the Document type (the DOCTYPE, which should be HTML5 in this class) does not permit h1 in content of u.

    Translation: does not not permit h1 in u

    Final Translation: an h1 tag can't be inside a u tag.

    Why can't an h1 tag be inside a u tag? Because u is an inline tag, and inline tags cannot contain block-level tags like h1.

    For more about block-level tag and inline tag rules, read HTML: Block-Level tags versus Inline tags.