You would by now have been introduced to the Internet and the World Wide Web (often just called the Web) and how it has changed our lives. Today we have access to a wide variety of information through Web sites on the Internet. We can access a Web site if we have a connection to the Internet and a browser on our computer. Popular browsers are Microsoft Internet Explorer, Netscape Navigator and Opera. When you connect to a Web site, your browser is presented with a file in a special format by the Web server on the remote computer. The contents of the file are stored in a special format using Hyper Text Markup Language, often called HTML This format is rendered, or interpreted, by the browser and you then see the page of the web site from your computer. HTML is one language in a class of markup languages, the most general form of which is Standard Generalized Markup Language, or SGML. Since SGML is complex, HTML was invented as a simple way of creating web pages that could be easily accessed by browsers.
HTML is a special case of SGML. HTML consists of tags and data. The tags serve to define what kind of data follows them, thereby enabling the browser to render the data in the appropriate form for the user to see. There are many tags in HTML, of which the few most important ones are introduced in this unit. HTML files usually have the extension “.htm” or “.html”. If you want to create Web pages, you need a tool to write the HTML code for the page. This can be a simple text editor if you are hand-coding HTML. You also have sophisticated HTML editors available that automate many (though not all) of the tasks of coding HTML. You also need a browser to be able to render your code so that you can see the results.
WHAT IS HTML?
As indicated earlier, HTML stands for Hypertext Markup Language. HTML provides a way of displaying Web pages with text and images or multimedia content. HTML is not a programming language, but a markup language. An HTML file is a text file containing small markup tags. The markup tags tell the Web browser, such as Internet Explorer or Netscape Navigator, how to display the page. An HTML file must have an htm or html file extension. These files are stored on the web server. So if you want to see the web page of a company, you should enter the URL (Uniform Resource Locator), which is the web site address of the company in the address bar of the browser. This sends a request to the web server, which in turn responds by returning the desired web page. The browser then renders the web page and you see it on your computer.
HTML allows Web page publishers to create complex pages of text and images that can be viewed by anyone on the Web, regardless of what kind of computer or browser is being used. Despite what you might have heard, you don’t need any special software to create an HTML page; all you need is a word processor (such as Microsoft Word) and a working knowledge of HTML. Fortunately, the basics of HTML are easy to master. However, you can greatly relieve tedium and improve your productivity by using a good tool. A simple tool is Microsoft FrontPage that reduces the need to remember and type in HTML tags. Still, there can always be situations where you are forced to hand code certain parts of the web page. HTML is just a series of tags that are integrated into a document that can have text, images or multimedia content. HTML tags are usually English words (such as block quote) or abbreviations (such as p for paragraph), but they are distinguished from the regular text because they are placed in small angle brackets. So the paragraph tag is <p>, and the block quote tag is <blockquote>. Some tags dictate how the page will be formatted (for instance, <p> begins a new paragraph), and others dictate how the words appear (<b> makes text bold). Still others provide information - such as the title - that doesn’t appear on the page itself. The first thing to remember about tags is that they travel in pairs. Most of the time that you use a tag - say <blockquote> - you must also close it with another tag - in this case, </blockquote>. Note the slash - / - before the word “blockquote”; that is what distinguishes a closing tag from an opening tag.
The basic HTML page begins with the tag <html> and ends with </html>. In between, the file has two sections -the header and the body. The header - enclosed by the <head> and </head> tags -contains information about a page that will not appear on the page itself, such as the title. The body - enclosed by <body> and </body> - is where the action is. Everything that appears on the page is contained within these tags.
HTML pages are of two types:
Static Pages
Static pages, as the name indicates, comprise static content (text or images). So you can only see the contents of a web page without being able to have any interaction with it.
Dynamic Pages
Dynamic pages are those where the content of the web page depend on user input. So interaction with the user is required in order to display the web page. For example, consider a web page which requires a number to be entered from the user in order to find out if it is even or odd. When the user enters the number and clicks on the appropriate button, the number is sent to the web server, which in turn returns the result to the user in an HTML page.