HTML/Training/Create HTML

From W3C Wiki
< HTML‎ | Training
Revision as of 01:16, 8 December 2011 by Jmarohni (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Create HTML

Edit tools

You don't need a special tool for making HTML. You can write HTML using just NotePad on Windows, or TextEdit on the Mac OS. However, you should choose an editor that allows you to save a page in the UTF-8 encoding (see more details below).

Some websites recommend using tools such as FrontPage and Dreamweaver for writing HTML, because they generate HTML for you. However, professional web developers highly discourage using such tools, because they often generate code that you don't want. Instead, it is considered a good practice that you write all HTML code yourself.

Although the HTML can be written with any text editor, specialized HTML editors can offer convenience and added functionality. But here we will just use a plain text editor, because we want to concentrate on learning.

try it

Let's make a HTML document.

1. Open the NotePad(Windows users) or TextEdit(MacOS users).

2. Write the following example.

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Sample Web page</title>
</head>
<body>
  <p>Hello!</p>
</body>
</html>

Note: Don't worry. You will learn the about these tags in the next chapter.

Saving the file

When you save the HTML document, you should follow the following two sections.

File names

File name's rules are as follows:

  • use either the ".htm" or the ".html" file extension.
  • use only alphabets, numbers, "-(hyphen)" and "_(underscore)".


Character Encoding

There are two works for the setting of the character encoding.

1. The markup within the document must properly designate the encoding.

2. The file, itself, must be saved in the proper encoding format.


The explanation of first point is learnt in the following chapter. In this chapter, you will learn second point. That is, setting the character encoding of the html document file.

See also:


try it (Notepad)

1. Click on the "File" menu and then on "Save as".

2. Select "UTF-8" in the dropdown menu of the "Encoding".

3. Put in the file name. In this example, "index.html".


try it (TextEdit)

1. Click on the "TextEdit" menu and then on "Preferences".

2. Click on the "Open and Save" tab.

3. Select "UTF-8" in the dropdown menu of the "Encoding".

4. Click on the "File" menu and then on "Save".

5. Put in the file name. In this example, "index.html".


Web browsers

Web browser is a software application for viewing the Web pages. There are a lot of kinds of Web browser and be used by each favor of the person who sees the Web pages:

  • Internet Explorer(Microsoft)
  • Firefox(Mozilla)
  • Chrome(Google)
  • Safari(Apple)
  • Opera(Opera)

...etc

You should check whether the Web page is correctly made by two or more Web browsers.

See also Web Browser Share.

try it

Let's view your HTML document on the Web browser.

1. Open the Web browser that you like.

2. Drag & Drop the HTML document file to Web browser.


Can you view the your HTML document?

In the next chapter, you learn about HTML tags. "HTML Document"