HTML Introduction

So, what is HTML?

HTML stands for HyperText Markup Language. It is a markup language, meaning that the majority page will be in standard text with the HTML markup tags specifying the formatting. Hypertext refers to the ability of a page to display links inside a text, allowing the reader to visit other documents from the page itself. HTML also has the ability to display graphics, webpage format, and even change display appearances... although that last bit is frequently regulated to the related CSS.

HTML uses Tags, which are marked with the ankle brackets, < and >, in order to keep them separate from the normal text of the page. Elements are the specific names for each tag, such as <p> being the paragraph element. Attributes are similar, but an Attribute is something which provides more information within a tag, while the Element is which tag itself is being used. <p> is a tag with the paragraph element, while <p id="no10"> is a tag with the paragraph element, and also the ID attribute. Some attributes are shared among many different types of elements, such as the id= attribute. Other attributes are specific to certain tags, such as <img src="image.jpg" /> which would not make much sense in most other tags anyways.

Tags come in two varieties. The most common form of element has two sets of tags, one which opens the element (such as <p>) and one which closes the element (such as </p>). The closing tag will always be similar to the opening one, just with a forward slash (/) right after the left ankle bracket, before the name of the tag. Closing tags always contain only the name of the element, not any of the attributes which are involved with it. <p id="no09">This is a paragraph!</p> is how you would see the paragraph element opened and closed, with the closing tag simply being </p>. The ID attribute would not be placed in the closing tag.

HTML uses tags to mark up a primarily text document. The tags can sometimes get rather thick and confusing, especially with trying to produce some complicated results, but for the most part it will involve plain text with tags to distinguish how the text will be formatted. For example:

This is a paragraph!
This is another line of the paragraph. displayed with the markup:

<p>This is a paragraph!<br />
This is another paragraph.</p>

There are a lot of tags which can be omitted when using HTML. It is intentionally designed to be very forgiving. For example, the above could be the only thing typed in a HTML document, ignoring the opening <html> and <head> and <body> tags, not to mention the similar closing tags, and still likely display the same. Even the </p> closing tag can end up forgotten and the webpage will likely still display the way you want. However, that is the key: it may display the same. The more tags which are left out or forgotten, the more ambiguity is present and so the greater chances that a different web browser might display the webpage differently than how you intended.

Also, forgetting to close your tags can have unintended results, such as marking your entire page in bold font. So it is generally better to always close tags when you want an element to end.

CSS is separate but related to HTML. It was designed primarily as a companion to HTML, and is used to create or change visual styles in HTML. CSS stands for Cascading Style Sheet, and looks more like what most people would expect a programming language to appear like. CSS is something which will be covered at another time.