Prev

Inline Styles

Two Easy Mistakes

There are many ways to make mistakes while writing HTML. We've already talked about a few, such as misspelling a tag. Two more include forgetting the "/" in the end tag of container tag or using a "\" instead. When you make this sort of mistake with an inline style, it is usually very obvious, but sometimes it is not so obvious when you do it with other tags, such as the <body> tag.

Forgetting the "/"

Tip: Check that end tags and stand-alone tags have a /
Computers are not nearly as skilled as people are at noticing and correcting certain kinds of mistakes. One such mistake is forgetting to put the "/" in the end tag or in a stand-alone tag. For example, although it may be easy for you to realize that you meant to end the <em> tag after the word "end" below, the browser just interprets it as the beginning of a new <em> container.
Example
<em>This is where the italics should end<em> and regular text should begin.
will appear as:
This is where the italics should end and regular text should begin.
when you intended:
This is where the italics should end and regular text should begin.

Using the "\" for "/"

Tip: Check that you use /, not \
Another easy mistake to make is to use the backward slash, "\" instead of the forward slash, "/". In HTML and URLs, you always want to use the forward slash, which is called "forward slash" because the top of it "points" to the right, which is forward to us, because we read left to right. Likewise, the backward slash is called so because it points to the left. The forward slash, the one you want to use, is on the same key as the "?" symbol, on the bottom right of most keyboards.

End of Topic

Prev