Instead of having a long chat, I'm going to start off with the teaching right away.
To type HTML, or Hyper-Text Markup Language, all you need is a simple text editing program, like Windows's Notepad or Mac's Simple Text, and an internet browser, like Microsoft's Internet Explorer or Netscape's Navigator. If you use a different text editor, remember to save your HTML document in text format with the extension .htm
. But don't save anything yet! First, just start up your text-editing program.
HTML is based on things called tags. A tag looks like this: <tag>
. Tags like that are used to insert things like images or paragraph breaks into a document. Sometimes, tags appear like this: <tag> Yadda yadda yadda </tag>
. The first tag is called the opening tag, while the second tag, with the /, is called the closing tag. If the tag that you are using, for example, is the boldface tag (we'll get to that a little bit later), then all the words inbetween the two tags will appear in boldface, like this. By the way, capitalization doesn't matter with tags. You can even use mixed cases. Your browser doesn't care.
The first pair of opening and closing tags that you need to learn, however, is the <html>
and </html>
tags. Put the opening HTML tag at the beginning of your HTML document, and the closing HTML tag at the end of your document. This tells your browser that everything between those tags (the yadda yadda yadda) is going to be HTML. Do that now, if you have your text editor open.
The second pair of tags is the <title>
and </title>
tags. In between these tags goes the title of your document, which appears in the title bar of your browser. For example, this page's title is Learn HTML, and looks like this in the HTML code: <title>Learn HTML</title>
. In your text editor, put these tags inbetween the HTML tags, as all HTML goes there.
If you've been entering these tags into your text editor, your document should look like this:
<html>
<title>Title of Document</title>
</html>
Remember: Capitalization doesn't matter. Also, in HTML, you can put as many or as little spaces or carraige returns (hitting the enter key) as you like, and it won't change a thing. In fact, all of the following pieces of code mean the same thing as the piece of code right above this paragraph:
<html><title>Title of Document</title></html>
Or...
<html>
<title>
Title of
Document
</title>
</html>
Or...
<html>
<title> Title of Document </title>
</html>
BUT!!!! The ONE thing to remember is to never, never, NEVER do THIS: <ta g>
!!!!!!!! NEVER! Okay, so it won't destory your computer, but your browser will understand that as much as it understands <hxhsdbsiseubd>
.
The third most important tags are the body tags, which you put inside the html tags, but after the title tags, like this:
<html>
<title>Title of Document</title>
<body>
</body>
</html>
In between the body tags is where the stuff in your web page will go. BUT FIRST!!! I am going to teach you what attributes are.
An attribute tells your browser certain things about tags, like how big you want a picture to be, or the color of the font. They go next to tags like this: <tag attribute>
. Make sure the attribute is inbetween the less-than and greater-than signs, or the browser won't think that it's an attribute.
Most attributes have values, and look like this: <tag attribute=value>
. The first attribute you'll need to know is the bgcolor attribute. It goes inside of the body tag, and its value tells your browser what color to make the background of your web page. This is what it would look like:
<html>
<title>Title of Document</title>
<body bgcolor=orange>
</body>
</html>