What is HTML?
HTML is a markup language for describing web documents (web pages).
- HTML stands for Hyper Text Markup Language
- A markup language is a set of markup tags
- HTML documents are described by HTML tags
- Each HTML tag describes different document content.
Example Explained
- The DOCTYPE declaration defines the document type to be HTML
- The text between <html> and </html> describes an HTML document
- The text between <head> and </head> provides information about the document
- The text between <title> and </title> provides a title for the document
- The text between <body> and </body> describes the visible page content
HTML Tags
HTML tags are keywords (tag names) surrounded by angle brackets:
<tagname>content</tagname>
- HTML tags normally come in pairs like <p> and </p>
- The first tag in a pair is the start tag, the second tag is the end tag
- The end tag is written like the start tag, but with a slash before the tag name
Note : The start tag is often called the opening tag. The end tag is often called the closing tag.
Web Browsers
The purpose of a web browser (Chrome, IE, Firefox, Safari) is to read HTML documents and display them.
The browser does not display the HTML tags, but uses them to determine how to display the document:
Note : Only the <body> area (the white area) is displayed by the browser.
HTML Versions
Since the early days of the web, there have been many versions of HTML:
Version Year
HTML 1991
HTML 2.0 1995
HTML 3.2 1997
HTML 4.01 2000
HTML 5 2014
Write HTML Using Notepad or TextEdit
HTML can be edited by using professional HTML editors like:
- Microsoft WebMatrix
- Sublime Text
However, for learning HTML we recommend a text editor like Notepad (PC) or TextEdit (Mac).
We believe using a simple text editor is a good way to learn HTML.
Follow the 4 steps below to create your first web page with Notepad.
Step 1: Open Notepad
- To open Notepad in Windows 7 or earlier:
- Click Start (bottom left on your screen). Click All Programs. Click Accessories. Click Notepad.
- To open Notepad in Windows 8 or later:
- Open the Start Screen (the window symbol at the bottom left on your screen). Type Notepad.
Step 2: Write Some HTML
Write or copy some HTML into Notepad.
Step 3: Save the HTML Page
- Save the file on your computer.
- Select File > Save as in the Notepad menu.
- Name the file "index.html" or any other name ending with html or htm.
- UTF-8 is the preferred encoding for HTML files.
- ANSI encoding covers US and Western European characters only.
Note : You can use either .htm or .html as file extension. There is no difference, it is up to you.
Step 4: View HTML Page in Your Browser
Open the saved HTML file in your favorite browser.
Note : To open a file in a browser, double click on the file, or right-click, and choose open with.
Empty HTML Elements
- HTML elements with no content are called empty elements.
- <br> is an empty element without a closing tag (the <br> tag defines a line break).
- Empty elements can be "closed" in the opening tag like this: </br>.
- HTML5 does not require empty elements to be closed. But if you want stricter validation, or you need to make your document readable by XML parsers, you should close all HTML elements.
____________________
Programs Code
Web Page#1: structure.html
Object: Demonstration of Basic Structure of an HTML Document
Source Code
Output
________________________________
Web Page#2: headings.html
Object: Demonstration of Heading Styles in HTML
Source Code
Output
_______________________________
Web Page#3: paragraphs-breaks.html
Object: Demonstration of Paragraphs & Line Breaks in HTML.
Source Code
Output
___________________________________
Web Page#4: textformatting.html
Object: Demonstration of Text Formatting Tags in HTML.
Source Code
Output
_______________________________
Web Page#5: computeroutput.html
Object: Demonstration of Computer Output Tags in HTML.
Source Code
Output
___________________________________
Web Page#6: abbreviation-acronym.html
Object: Demonstration of Abbreviations & Acronyms in HTML.
Source Code
Output
_______________________________
Web Page#7: quotations.html
Object: Demonstration of Long & Short Quotations in HTML.
Source Code
Output
_____________________________________
Web Page#8: right2left.html
Object: Demonstration of Right To Left (RTL) or Hebrew Text in HTML.
Source Code
Output
________________________________
Web Page#9: preformatted.html
Object: Demonstration of Preformatted Text in HTML.
Source Code
Output
______________________________________
Web Page#10: comments-address.html
Source Code
Output
___________________________________
More Program's In HTML Part 2
_____________