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


Q1:I noticed in some of the HTML source code examples you showed that the lines of code in the header were indented. What does indenting do?
A1: Nothing. The indenting of blocks of HTML code has no effect on the display of the page; the indenting is there for the same reason some editors color-code the HTML when showing it to you. Authors (and most editors) indent portions of code to make the structure of the file easier to understand when a person reads it. Browsers don't care; they pay no attention to indents in HTML source code, so do whatever works best for you.
Q2:I've also noticed that tags are sometimes typed in uppercase letters (<TITLE>) and other times lowercase (<title>). Does it matter which I use?
A2: Browsers today don't care whether you use uppercase tags, lowercase tags, or both—they pay no attention to the case of the letters used in tags, and the tags have the same effect either way. You might have noticed that Composer uses lowercase tags (refer to Figure 17.8) and that HTML Assistant uses uppercase tags (refer to Figure 17.9). Same dif.

For years, the accepted convention among Web authors was to use uppercase tags. Because most of the text content of a page was likely to be lowercase (with uppercase letters only at the beginnings of sentences and on proper nouns), the experts of the time thought that using uppercase tags helped the author easily distinguish tags from content. That's the same reason, in this hour, that I mostly used uppercase tags—so that they stand out from my description around them.

Given that you'll probably spend most of your HTML coding time editing HTML files originally produced by programs, staying flexible and cultivating the ability to work either way pays off. In fact, you might want to always do the opposite of what the program does; for example, when editing the all-lowercase HTML code that Composer creates, write your edits in uppercase—that makes it easier to see what you've changed if you need to resolve a problem later.

Eventually, all coding is likely to be required to be lowercase. That's because HTML will one day be supplanted by a new standard, XHTML (see Hour 24), in which tags must be lowercase. But that's still a while away.

Q3:I've looked at the source for some pages on the Web, and I've seen lines of text preceded by a <!- tag. The text doesn't seem to be part of the header, but it is displayed nowhere in the browser view of the page. Que pasa, mi amigo?
A3: Any text preceded by <!- is a comment, a note inserted in the file to explain something to anyone who might read the HTML source code. Comments are inserted by programmers in all types of program code, including HTML, to help others (or even the programmer) understand the code when reading it. Comments have no effect on the display or actions of the document, and the text within comments is hidden when the browser displays the document. (In Composer, you can add comments to the HTML by choosing Insert, Comment.)



Not a subscriber?

Start A Free Trial

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