General
Computing
Concepts
Presentations Spreadsheets Web Design Word
Processing
Appendices

Study Guide: Web Design - Good Practices

<<Previous Next>>

Now that you've coded your own pages, you should have a feel for editing HTML code. You have probably noticed by now that editing the code can be confusing when tags are not lined up so that they are readable. Everyone will have his or her own style, but use alignment and white space to your own advantage so that you can read your own code. Indentation is a wonderful tool to show tags that are nested inside each other.

COMMENTS

As your pages become more robust and complicated, it is vital that you have good, consistent practices when it comes to alignment and indentation. Usually, it helps to align end tags at the same level as their begin tags. Sometimes, though, the end tag might be on the same line as the begin tag.

There is also a comment in HTML. A comment is visible in your HTML code but not on your web page. To delineate a comment, use <!-- at the beginning of the comment and --> at the end of the tag. Like this:

<!-- Here's a table about the homes of the pigs -->

You can also use comments to comment out a section of HTML code. If you'd like to remove a portion of your page temporarily, but you'd like to leave the code there because you might add it back in later, you can enclose a whole section of your document in a comment. Just be sure that all the end tags belonging to the begin tags inside the comment are also inside the comment.

.

 

Tek.XamReturn to Home