Friday, 8 January 2016

What is an HTML Document? - Structure, Types & Examples

Instructor: Szymon Machajewski Szymon has taught Computer Science at a number of Higher Education institutions.

An HTML document is a file containing HyperText Markup Language, and its filename most often ends in the .html extension. An HTML document is a text document read in by a web browser and then rendered on the screen.

Definition

An HTML document is a file containing HTML code. HTML code is based on tags, which provide special meaning and instructions to text between them. A tag starts with an angle bracket, the 'less than' sign: '<'. The tag ends with an angle bracket, the 'greater than' sign '>'. Tags tell the processing program, often the web browser, what to do with the text. For example, to make the word 'Hello' bold, you would use the opening bold tag <b> and then the closing bold tag </b>, like this:
<b>Hello</b>
HTML is defined by the World Wide Web Consortium, an organization which regulates standards for the Internet, and each version of HTML has a set of definitions. Note that HTML is not a programming language. While we often refer to HTML markup as HTML code, a programming language requires the processing of logical statements and math. HTML allows the developer to make text documents look engaging and pleasant. In most cases, programming on an HTML document is done with JavaScript.

Types of HTML

The most common version of HTML in use is HTML 4. The new version of HTML, which is entering the industry, is HTML 5. HTML can be divided into three categories: transitional, strict, and frameset. These types apply to how HTML is used, not necessarily to the selection of tags.

Transitional

The transitional type is the most common type of HTML. It has a flexible syntax. Over the years, the transitional HTML has been used without syntax restrictions, and browsers support 'best effort' approach to reading the tags. If tags are misspelled, the browsers do not correct web developers' errors, and they display content anyway. Browsers do not report HTML errors - they simply display what they can. This is the 'best effort' concept.

Strict

The strict type of HTML is meant to return rules into HTML and make it more reliable. For example, the strict type requires closing tags for all opened tags. This style of HTML is important on phones, where the processing power may be limited. A clean and error-free code helps to load pages faster.

Frameset

Finally, frameset allows web developers to create a mosaic of HTML documents. Multiple documents can be connected into a single screen. This technique is often used to create a menu system. You click on a menu item on the left side of the screen, and only the right side of the screen re-loads. The menu stays in place.

HTML Examples

Let's take a look at a few examples. To execute the examples, simply create a text document on your desktop called 'test.html'. If you are using a Notepad program, please make sure the extension on the file is .html, not 'test.html.txt'. To do this, use 'Save As' in Notepad and then include in a double-quote as the name of the file 'test.html'. On your desktop, you will see an icon with 'test' as the name, and the picture on the icon will have a web browser association.

Stay tuned on www.olalekanakeem.blogspot.com to be continued soon. for the benefit of nd2 computer science students, Federal Polytechnic Ede Osun State Nigeria 

No comments:

Post a Comment