Home arrow HTML arrow Page 4 - Beginning HTML

Beginning HTML

Ask anyone who invented the Internet, and they will likely look at you and shake their head in confusion, even though most people couldn't live without it for a day. Of course, if you asked Al Gore, he would say he did. But the people who really invented the Internet are also important for another, related reason.

Author Info:
By: James Payne
Rating: 4 stars4 stars4 stars4 stars4 stars / 6
January 08, 2008
  1. · Beginning HTML
  2. · Formatting HTML Documents
  3. · Inserting a Line Break
  4. · Comments
  5. · Formatting Text

print this article

Beginning HTML - Comments
(Page 4 of 5 )

You will notice in the above coding sample a line that says <! I am a comment! The computer does not see me tee-hee!>. This is known as a comment line. When the browser sees the <! > it turns a blind eye to whatever is in the comment tag and does not read it.

Comments are used to remind yourself and to tell other programmers the purpose of specific pieces of code. That way when you look at your code a year later or the person who replaces you looks at it, they understand more easily what you were trying to accomplish should a problem arise or a modification be needed. They aren't necessary, but it is considered good programming practice to include them.

Horizontal Rules!

If this weren't a pg-13 audience I might take the time to explain that. Horizontal rules are a good way to separate lists of data or sections of documents. Basically, it inserts a line like the one below:



To insert a horizontal rule, just use the <hr> tag.


To align text, observe the following code:



<h1 align="center">This is heading 1</h1>

<p align="right">This paragraph is right aligned </p>

<p>This paragraph is left aligned by default </p>

<p align="center">This paragraph is centered</p>



This gives us the following output:

This is heading 1

This paragraph is right aligned

This paragraph is left aligned by default

This paragraph is centered

Changing the Color of Your Background

Changing the color of your background is pretty simple also. Look at this code:


<body bgcolor="purple">

<h1>Example of a colored background</h1>



This will change your background to purple. If you want it red, replace the word purple with red, etc. We will go over the available colors and color codes later on in this tutorial.

blog comments powered by Disqus

- Does HTML5 Need a Main Element?
- Revisiting the HTML5 vs. Native Debate
- HTML5: Not for Phone Apps?
- HTML5 or Native?
- Job Hunting? Freelancer.com Lists This Quart...
- HTML5 in the News
- Report: HTML5 Mobile Performance Lags
- The Top HTML5 Audio Players
- Top HTML5 Video Tutorials
- HTML5: Reasons to Learn and Use It
- More of the Top Tutorials for HTML5 Forms
- MobileAppWizard Releases HTML5 App Builder
- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials