| Chapter 1: Introduction | ||
| Home | Next Chapter 2: The Head |
|
Hypertext Markup Language, or HTML, is the predominant language for writing Web pages today. Technically, HTML is not a programming language, but rather a markup language - the text is simply typed and "marked up" by adding special keywords to achieve special effects.
HTML was invented in 1989 by Tim Berners-Lee of Cern, Switzerland. HTML's simplicity made it an instant hit with the tiny community that was on the Internet at that time. Up until 1993, the Internet was completely text-based.
In 1993, Marc Anderssen devised a new keyword for displaying pictures with HTML. This new, graphical version of HTML was then programmed into the Mosaic Browser by the National Center for Supercomputing Applications (NCSA). As you can probably imagine, this development took the computing world by storm.
As new browsers were created, their programmers added more and more functions to HTML. The only problem was that they would then copyright those features, so that only their browser would support them. Since there were so many different browsers in use, Web site writers had no idea what features were compatible with their audience's browser.
The World Wide Web Consortium (W3C), the overseeing agency of Internet standards, realized the problems that this could cause and put a stop to it by setting strict rules that all browsers must comply with. Even now, the W3C meets regularly to decide on new features that the next version of HTML will support. The current specification of HTML is version 4.01, which includes a total of 40 keywords.
Recently, to improve performance for Web browsers on devices with limited resources - such as cell phones and PDAs - HTML was reformulated as a derivative of the more general XML language. This edition of HTML is called XHTML (eXtensible HTML) and is basically the same, but has some differences in the rules that one follows to code the page (the rules of a language are called its syntax). These differences follow the established syntax rules for XML and make it easier for browsers to decode.1 The current version of XHTML, which we will study in this book, is XHTML 1.1.
Now, Tim Berners-Lee is a director of the W3C. Marc Anderssen founded a private company (called Netscape), added some features to the Mosaic browser, and launched it. The rest is history - Netscape Navigator is now the second-most popular Web browser in the world, and Anderssen is a millionaire.
You don't really need fancy, expensive programs to make Web pages - XHTML content can be created in a simple text editor like Windows Notepad (accessed through Start > Accessories > Notepad) or any of the assorted editors (Kate, gedit, vim, emacs) availiable on a Linux machine. To create an XHTML page, just type the code into Notepad and save the file with a *.htm or *.html extension. (The HTML extension is still used in XHTML documents.) In Notepad, this is done by typing the filename and extension enclosed in "quotation marks" into the Save dialog. For example, "hello.htm" or "index.html" will both create an HTML page.
However, HTML (and sometimes) can also be automatically generated with specialized editors like FrontPage and Visual InterDev (both by Microsoft), and Fusion (by NetObjects). In addition, Microsoft Word (2000 and up) can generate HTML code. However, these programs may use old versions of HTML and therefore be out-of-date. In addition, these programs may add extra code that can dramatically increase the size of the page, or the code-generating algorithm may not adhere completely to the XHTML standard.
To write a Web page, simply type the text that you want the page to say. This makes for a pretty boring page, though - so text and graphics are added using an HTML tag. Tags are special keywords placed between <angled brackets>. For example, the <b> tag bolds text.
All tags require a closing tag, which usually ends the effect of the tag. If you omit the closing tag (which is bad practice anyhow), that effect will last to the end of the page. For example, the bold tag will make everything in the page after the tag bold. To make the bold stop, use the exact same tag again, but put a / slash in it. For example, to stop bolding text, use </b>. This called a closing tag.
CAUTION
HTML tags are not "case-sensitive." However, in XML, all tags must be in lower-case.
Some tags do not permit any content to lie between their start and end tags. These are called empty tags. For example, the line-break tag, which starts a new line, must look exactly like this: <br></br>. However, this is repetitive. Therefore, it is allowed to use a shorthand system for indicating that a tag is empty. This is to place a slash before the right angle bracket, like so: <br/>
NOTE
Some tags are not required to be empty, but for certain reasons it may be desirable for them to have no content, e.g. to create a blank cell in a table.
XHTML documents have two main parts: the head and the body. The head provides code that tells the browser how to display the page. Generally, this will not show up on the screen. Advanced effects like borders, text colors, fonts, and the like are applied in the head of an HTML document. The head is surrounded by <head></head> tags.
The body is the main section of the document that contains the text and tags that will actually be shown on the screen. It is surrounded by <body></body> tags, of course.
We've covered the basic stuff that you need to know to start working with HTML. So now, we're ready to go...
| Home | Next Chapter 2: The Head |
|
|
| ||