|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Want a new Job?
Chapters
Services
Feature Zones
|
Getting Started with HTML - First Things FirstSo you want to learn HTML? Let me guess. You have been surfing the net for a couple of months now, and you can't stop thinking about how these genius webmasters design web sites and keep them going on the net. Well, in all actuality, designing a website is not a five-year project. With a little creativity and desire, you could have a personal site running on your computer within ten minutes of reading the first couple of sections in this tutorial. Don't get me wrong, with the new programming languages constantly arising, the sites you see on the net by major companies require knowledge of a much more complex programming language or combination of languages. However, you don't need knowledge of complex web programming languages to tailor a website to meet your needs and look professional while doing it. HTML provides the basic tools for designing a simple, professional website, and it can easily be self taught. HTML (HyperText Markup Language) is a web programming language designed to create web documents or web pages. Based upon SGML (Standard Generalized Markup Language), HTML's basic concept involves the use of "tags". These "tags", "mark up" or alert the browser that the document contains hypertext so it can be interpreted and rendered as a web page document. All HTML documents consist of a mix and match of HTML "tags" and "regular" text. Tags only aid in describing the document content or text, and thus leave the actual appearance and layout decisions for a web browser to handle when the web page is rendered or opened. HTML documents are plain-text files that can be created using any basic or high-level text editor, such as Notepad, TextPad, or Microsoft Word or any other HTML authoring program. When you create an HTML document, you must save it with a .html or .htm extension. By default, most text editors save documents with a .txt extension, which is not capable of being displayed by a web browser. The .html or .htm extension allows the document to be rendered and displayed by a browser. Unfortunately for web designers, web documents are browser dependent; sometimes, different browsers display content differently. A document may look crisp and clean in Internet Explorer, but it may have a slightly different look in Netscape, or vice versa. Web page designers should make every attempt to create portable HTML documents that can be opened by many different web browsers while showing little or no visual differences. Reliable HTML web pages are created by following all syntax rules and understanding which tags are supported by all web browsers. So, what does a person need to create a web page? A simple text editor, and a web browser. It's that simple. In most cases, a web page, or web site which is a collection of related web pages, should be designed locally on a computer first, and then once completed, the web documents and files may be uploaded for publishing on the World Wide Web. This makes web site or web page creation, extremely easier than trying to edit existing documents on the WWW. Before reading further and learning actual HTML code, you should become familiar with the following short listing of terms:
You now have a brief background of HTML and are ready to dig deep into the core of the language. The next section will show you how to create your first web page document. Read on for more about where you should begin... Ground Zero - Where Do I Begin?Every HTML document should contain the basic document structure tags, which include <html>
<head><title></title>
</head>
<body>
</body>
</html>
Open a simple text editor program such as Notepad on a Windows machine, copy and paste the above code into the editor, save the file with a .html or .htm extension, and open the file using a web browser. Congratulations, you have now created your very first web page. Upon opening of the above HTML code example in a web browser, a blank white or gray screen should appear in the content area of the browser. Why? Well, no elements have yet been provided in the document other than the basic document structure tags. By default, web browsers display text in black, hyperlinks in blue, and the background in white or gray, with top and bottom margins set at 15 (pixels) and right and left margins set at 10 (pixels). To override these default values, simply alter the values of the corresponding Standard Attributes
Non-Standard Attributes
Non-Standard JavaScript Supported Attributes
Example: For a black background, orange text, white hyperlinks, and all margins set at 0, alter the <body bgcolor="#000000" text="#FF2400"
link="#FFFFFF" topmargin=0 bottommargin=0 leftmargin=0 rightmargin=0>
Important note: The six digit, number and letter The following displays some of the more basic colors and their corresponding hexadecimal values: Examples of Hexadecimal Colors
When manipulating <body background="stone.gif">
This will "tile" the image of stone.gif across the background of a web page, provided the image is in the current web directory. Since the image is displayed in a "tiled" format, the creation of repetitive background images are commonly used to minimize web page loading and downloading time. To create a web page document, follow these 6 simple steps:
For a web page example, follow the above steps and insert the following HTML code in place of the document structure tags. Note: See later sections for tags not covered in this section: <html>
<head><title>My First Web Page - HTML is simple!</title>
</head>
<body bgcolor="#FFFFFF" text="#FF0000">
<h2>Hello, world. HTML is easy!</h2>
</body>
</html>
By now, you should have already created your first web page document. I told you it wasn't difficult. The next section introduces you to several "tags" you need to know to give your web page a professional, clean look. Read on for more about tags... HTML Tags - It's All About TagsSince HTML stems from the basic concept of using tags, the more a designer becomes familiar with various tags, the better that designer will be able to create customized web pages. HTML tags are made up of a left angle bracket ( < ), a tag name and a right angle bracket ( > ). Tags normally have a start and end tag but some tags only need a beginning tag to function. The end tag is identical to the start tag with a backslash ( / ) preceding the text between the angle brackets. The general form of a tag is as follows: <tagName> </tagName>
where The following is a brief overview of the basic document structure HTML tags:
Document structure tags define the global regions of a web page but do nothing to describe web page content. The following are some useful document formatting tags and text tags designed to "describe" web page content:
Some text cannot be explicitly placed as "regular" text in a web page document source code because the text has meaning to the syntax of HTML, there is no keyboard character value for the text, etc. Certain character values are not able to be displayed because they have reserved meaning in HTML. For example, a less than operator and greater than operator have pre-defined "tag" meanings and are therefore not able to be displayed by solely placing ( < ) or ( > ) in HTML source code. However, certain HTML code specifiers make it possible to display these reserved characters. The following are a few useful specifiers:
It is important to note that the space inserted between the ambersand sign and specifier is only provided in this article for display purposes. There should be no space in actual web document source code. The next section will provide you with more ideas on how to format characters and text in your HTML documents. Read on for more about character formatting... Character Formatting - How to Spice Up TextThe style of document content text in web pages, plays a huge role in the overall design of web sites. HTML provides many tags for formatting text and specifying text characteristics. Physical type styles are designed to describe text characteristics, and block-level text tags are used for formatting purposes. The following is a listing of popular physical type styles:
For an example, consider the following HTML code segment: <b>Using bold characteristic tag.</b><br>
<i>Using italic characteristic tag.</i><br>
<u>Using underline characteristic tag.</u><br>
<tt>Using fixed width font characteristic tag.</tt><br>
Using <sub>subscript</sub> format.<br>
Using <sup>superscript</sup> format.<br>
The above HTML code would produce the results in the following box, in a web browser:
The following is a listing of popular block-level text tags:
For an example, consider the following HTML code segment: <h3>Welcome!</h3>
<p>Beginning of document content.</p>
<div align="center">Ending of document content.</div>
The above HTML code would produce the results in the following box, in a web browser:
Explicitly changing font text types can also be accomplished through the capabilities of the <font face="arial" size=4pt color=#000080>
4PT font size rendered in Arial Type</font>
The above HTML code would produce the results in the following box, in a web document:
The following HTML code segment illustrates the size of possible point values when using the font tag: <font size=1pt face="arial" color=#FF2400>1 point arial type text</font>
<font size=2pt face="arial" color=#FF2400>2 point arial type text</font>
<font size=3pt face="arial" color=#FF2400>3 point arial type text</font>
<font size=4pt face="arial" color=#FF2400>4 point arial type text</font>
<font size=5pt face="arial" color=#FF2400>5 point arial type text</font>
<font size=6pt face="arial" color=#FF2400>6 point arial type text</font>
<font size=7pt face="arial" color=#FF2400>7 point arial type text</font>
The above HTML code would produce the results in the following box:
Important note: In order for a specified font to override the default font displayed by a web browser, the visitor to a web page must have the specified font to be used installed on his/her computer. For example, if choosing to use the font type ocra as the font type for text on a web page, then visitors to the page must have the ocra font installed on their computer; otherwise, they will see the default font type used by the browser. It is also possible and very common to combine physical type styles with block-level tags. Care must be taken to ensure that all HTML syntax rules are followed. When designing web pages, web authors constantly experiment in order to find a perfect look for a web site. Character formatting and text characteristics are very important in giving a web site that "perfect" visual look, but most of these tags have been left in the dark due to the popularity of a much more powerful coding scheme: CSS (cascading style sheets). HTML Lists - Looking Sharp and OrganizedThere may be times when web designers need to organize document information or images in a neat, list format. HTML supports the following three block-level list types: unnumbered ( Unnumbered or unordered lists are usually displayed with bullets, which depict each new line of information to be displayed in the list structure. Unordered lists should be used when needing to display related group of data not necessarily in a particular order. The following are the steps required to create an unnumbered list:
Note: The The following code illustrates an example of an unnumbered list: Example 1: Unnumbered/Unordered list <html>
<head><title>Unordered List Example</title></head>
<body>
<ul>
<li>List Item 1
<li>List Item 2
<li>List Item 3
<li>List Item 4
</ul>
</body>
</html>
The above HTML code would produce the results in the following box, in a web browser:
Numbered lists are coded identical to an unnumbered list except for the opening and closing tag, which are: Note: The VALUE MEANING
1 Arabic (1, 2, 3, ...) [default]
A Alphabetic uppercase
a Alphabetic lowercase
I Roman numeral uppercase
i Roman numeral lowercase
The following code illustrates an example of a numbered list: Example 2: Numbered/Ordered list <html>
<head><title>Numbered List Example</title></head>
<body>
<ol type="A">
<li>List Item 1
<li>List Item 2
<li>List Item 3
<li>List Item 4
</ol>
</body>
</html>
The above code would produce the results shown in the following box:
Definition lists can be used for two purposes. If needing to list terms and definitions, designers can use alternating definition tags The following examples illustrate the two types of definition lists: Example 3: Definition list - terms and definitions <html>
<head><title>Definition List Example</title></head>
<body>
<dl>
<dt><b>Word 1</b></dt><dd>This corresponds to
the meaning of word 1.</dd><br><br>
<dt><b>Word 2</b></dt><dd>This corresponds to
the meaning of word 2.</dd><br><br>
<dt><b>Word 3</b></dt><dd>This corresponds to
the meaning of word 3.</dd><br><br>
<dt><b>Word 4</b></dt><dd>This corresponds to
the meaning of word 4.</dd><br><br>
</dl>
</body>
</html>
The above HTML code would produce the results in the following box, in a web browser:
Example 4: Definition list - custom bullet list <html>
<head><title>Definition List Example</title></head>
<body>
<dl>
<dd><img src="imgarrow.gif"> List item 1</dd><br>
<dd><img src="imgarrow.gif"> List item 2</dd><br>
<dd><img src="imgarrow.gif"> List item 3</dd><br>
<dd><img src="imgarrow.gif"> List item 4</dd>
</dl>
</body>
</html>
The above HTML code would produce the results in the following box, in a web browser:
In conclusion, lists allow for document content to be displayed in a neat, easy to read manner, and also add overall document structure. Hyperlinks - Getting Out and AroundA hyperlink is text, an image or any other object in an HTML document that can be clicked, in order to gain access to an external web site, an internal web page, an external web page or an internal section within an HTML document. An external link provides access to another web site that is not part of the current web site, such as going to Google from PHeaven. An internal link provides access to another web page which is part of the original web site, such as going to the next article in this guide from this web page. An external web page link provides access to a web page that is part of another web site. An internal section link points to a region within a web page document. Hyperlinks are easily noticed in a web page document because, by default, they are underlined and painted blue (unless otherwise specified), and a mouse pointer will change to a hand with the index finger pointing to the link, indicating that the web user may click on the text, image or object. Also, by default, image hyperlinks are given a distinct border color (unless otherwise specified). HTML provides ways to manipulate the color of links, visited links and active links by using the following attributes of the
<img src="imageURL" alt="this image" border="0">
The link anchor tag has the following form: The URL, which is the full file path of the destination, is to be placed between the quotes. The <a href="URL" target="_blank">
The following illustrates how to link to a web site: <a href="http://www.programmersheaven.com"
target="_blank">Programmer's Heaven</a>
The following illustrates how to link to a web page that is part of a web site: <a href="http://warebiz.tripod.com/cpp.htm">
[warebiz] :: C++ Ripped Apart</a>
The following illustrates how to produce internal web document links:
The following illustrates how to create a linkable image with no border color: <a href="linkURL"><img src="imageURL" border="0"></a>
In summary, the anchor tag With hyperlinks covered, we can now move on to the wonderful world of tables. In my opinion, tables are the most important aspect of the HTML language. You can design an entire web page with the whole blueprint grid of the page being one large table. Tables allow you to place images, objects and text in the exact position that you specify. Read on for more about tables... HTML Tables - Far From Picnic TablesIn the everyday world, a table is commonly used to present tabular information such as schedules, statistics, etc. In the world of HTML, a table is also used for these purposes but it is more commonly used for organizing the content of complex web pages. Many web designers prefer to create on overall web site layout through the use of a single table. A table lets web designers make use of rows and columns so they can specify precisely where text, images and objects are to be placed on their documents. This is what makes the Table Elements and Corresponding Attributes
Table Attributes
The following tags must be placed within the
The following are examples illustrating how tables can be used to provide structure to web documents. Tabular structure, complex web page structure, border tricks, and complex web page structure with a navigational menu is emphasized. Table Example 1: (simple table display for tabular information) <html>
<head><title></title></head>
<body>
<table border=1 width=300>
<caption><font size=2pt face="arial">Example Table</caption>
<tr>
<th bgcolor=#000000><font size=2pt
face="arial" color=#FFFFFF>Heading</font></th>
<th bgcolor=#000000><font size=2pt
face="arial" color=#FFFFFF>Heading</font></th>
</tr>
<tr>
<td align="left"><font size=2pt face="arial">Text A</font></td>
<td align="right"><font size=2pt face="arial">Text B</font></td>
</tr>
<tr>
<td align="center"><font size=2pt face="arial">Text C</font></td>
<td align="center"><font size=2pt face="arial">Text D</font></td>
</tr>
<tr>
<td align="left"><font size=2pt face="arial">Text E</font></td>
<td align="right"><font size=2pt face="arial">Text F</font></td>
</tr>
<tr>
<td align="center" colspan="2">
<font size=2pt face="arial">Text G</font></td>
</tr>
</table>
</body>
</html>
The above HTML code would produce the following results in a web browser:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||