• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 24. Testing and Debugging Web Pages > Checking the Easy Stuff: HTML

Checking the Easy Stuff: HTML

While validators can usually point you to the errors in your code, sometimes it’s hard to figure out what they’re complaining about (and sometimes they’re offline and unavailable). Here are some common problems with HTML code.

To check the easy stuff with HTML

  • Make sure you’ve spelled everything right. I can’t tell you how many times I write scr instead of src (which stands for source, by the way).

  • Be careful about nesting. If you open <h2> and then use <b> make sure the closing </b> comes before the final </h2>.

  • The final / in empty XHTML tags is not part of the HTML specification. If you want the file to validate as HTML, you’ll have to get rid of it. (Better yet, switch to XHTML.)

  • Make sure the DOCTYPE matches the HTML you’re actually using. For example, if you want to use deprecated tags, don’t use HTML strict, use HTML transitional (see pages 38 and 60).

  • Avoid non-standard tags. Their support across browsers is notoriously spotty.

  • Be aware that most valid DOCTYPE declarations will make IE and Netscape go into standards mode. If you’re relying on old quirky behavior, you may be disappointed (see page 39).

  • If accented characters or special symbols are not displaying properly, see Chapter 20, Symbols and Non-English Characters.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint