If you want a more detailed tutorial of many features of HTML, w3schools.com is a good place to start.
An HTML file is a plain text file that has an extension of htm or html. It contains special tags that indicate how you want a browser to display the contents of the file. All tags are enclosed in < and >. A lot of tags have an "opening" form, like <html>, as well as a "closing" form like </html>. The / in front of a closing form says that it is balancing an opening one that occurs before it.
There are many "standards" published for HTML. Some are closely followed by all browsers, some are ignored by most browsers. If you stay with very basic, simple HTML, you can be fairly confident that your HTML pages will display properly in all browsers. Sloppy HTML - missing tags, missing closing tags - will usually be interpreted by most browsers in the best way they can.
The standard form for an HTML file starts out with:
<html> <title> xxx </title> <body> xxx xxx </body> </html>
Note that the closing tags are nested properly inside each other.
The title line above is what will show in the Title bar of the browser, and usually what will be saved as the description of a Bookmark or Favorite if you choose to save the page as a bookmark. The body contains most of your text to display.
Tag | Meaning/Useage | Closing Tag |
---|---|---|
p | paragraph start | /p (not often used) |
b | bold | /b |
table | starts a table | /table |
tr | starts a row of a table | /tr |
td | starts data of an entry in a table | /td (seldom used) |
By default, the alignment of most elements on the page are left-justified, at the left margin. If you want to have it centered, you can use the phrase "align=center".
Example: <p align=center>will center the paragraph that is starting.
The size of text in the page can be adjusted in several ways. <h1> is the largest text size; </h1> ends it. h2 is smaller than h1, h3 is smaller still. The exact size of the text in these blocks depends on the browser settings.
Tables are fairly straightforward to create. Between the <table> tag and the </table> tag, you describe what you want for a header row (if any) and for each row with data to be displayed.
<table> <tr><th>Column 1<th>Column 2<th>Column 3</tr> <tr><td>Data 1 1<td>Data 1 2<td> Data 1 3</tr> <tr><td>Data 2 1<td>Data 2 2<td> Data 2 3</tr> </table>gives you this:
Column 1 | Column 2 | Column 3 |
---|---|---|
Data 1 1 | Data 1 2 | Data 1 3 |
Data 2 1 | Data 2 2 | Data 2 3 |
An addition to the table tag is "border". Simply saying <table border> will cause the table to have visible lines drawn around each entry. <table border=10> will cause the lines to be thicker.
Column 1 | Column 2 | Column 3 |
---|---|---|
Data 1 1 | Data 1 2 | Data 1 3 |
Data 2 1 | Data 2 2 | Data 2 3 |
One way to learn about HTML is to call up a web page in a browser and use the View/Source for the page. The HTML will be displayed in a window like Notepad.