Professional Documents
Culture Documents
What is HTML?
HTML is a computer language devised to allow website creation. These websites can then be viewed by anyone else
connected to the Internet. It is relatively easy to learn, with the basics being accessible to most people in one sitting; and
quite powerful in what it allows you to create. It is constantly undergoing revision and evolution to meet the demands and
requirements of the growing Internet audience under the direction of the W3C, the organisation charged with designing
and maintaining the language.
The definition of HTML is HyperText Markup Language.
HyperText is the method by which you move around on the web by clicking on special text
called hyperlinks which bring you to the next page. The fact that it ishyper just means it is not linear i.e. you
can go to any place on the Internet whenever you want by clicking on links there is no set order to do things
in.
Markup is what HTML tags do to the text inside them. They mark it as a certain type of text (italicised text, for
example).
HTML is a Language, as it has code-words and syntax like any other language.
page. Different tags will perform different functions. The tags themselves dont appear when you view your page through
a browser, but their effects do. The simplest tags do nothing more than apply formatting to some text, like this:
In the example above, the <b> tags were wrapped around some text, and their effect will be that the contained text will
be bolded when viewed through an ordinary web browser.
If you want to see a list of a load of tags to see whats ahead of you, look at this tag reference. Learning the tags
themselves is dealt with in the next section of this website, My First Site.
TML Example
A small HTML document:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
HTML Tags
3
HTML tags are keywords (tag names) surrounded by angle brackets:
<tagname>content</tagname>
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
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:
----------------------------------------------------------------------------------------------------------------------------------------------------------
(but many people also refer to it as a tag). Some elements come in pairs that
indicate when some display effect is to begin and when it is to end.
HTML is a formal Recommendation by the World Wide Web Consortium
(W3C) and is generally adhered to by the major browsers, Microsoft's Internet
Explorer and Netscape's Navigator, which also provide some additional nonstandard codes. The current version of HTML is HTML 4.0. However, both
Internet Explorer and Netscape implement some features differently and
provide non-standard extensions. Web developers using the more advanced
features of HTML 4 may have to design pages for both browsers and send
out the appropriate version to a user. Significant features in HTML 4 are
sometimes described in general as dynamic HTML. What is sometimes
referred to as HTML 5 is an extensible form of HTML called Extensible
Hypertext Markup Language (XHTML).
What is HTML?
Firstly, HTML is short for "HyperText Markup Language". That may sound scary, but it simply
means it is a language for describing web-pages using ordinary text. HTML is not a complex
programming language.
HTML Tags
HTML tags are the hidden keywords within a web page that define how the browser must
format and display the content.
Most tags must have two parts, an opening and a closing part. For example, <html> is the
opening tag and </html> is the closing tag. Note that the closing tag has the same text as the
opening tag, but has an additional forward-slash ( / ) character. I tend to interperet this as the
"end" or "close" character.
There are some tags that are an exception to this rule, and where a closing tag is not required.
The<img> tag for showing images is one example of this.
Each HTML file must have the essential tags for it to be valid, so that web browsers can
understand it and display it correctly.
The rest of the HTML file can contain as little or as many tags as you want to display your
content.
HTML Editors
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.
6
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.
7
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.
You can use either .htm or .html as file extension. There is no difference, it is up to you.
To open a file in a browser, double click on the file, or right-click, and choose open with.
What is my browser?
A browser is software that is used to access the internet. A browser lets you visit
websites and do activities within them like login, view multimedia, link from one site
to another, visit one page from another, print, send and receive email, among many
other activities. The most common browser software titles on the market are:
Microsoft Internet Explorer, Google's Chrome, Mozilla Firefox, Apple's Safari, and
Opera. Browser availability depends on the operating system your computer is
using (for example: Microsoft Windows, Linux, Ubuntu, Mac OS, among others).
-------------------------------------------------------------------------------------------A browser is an application program that provides a way to look at and interact with all the
information on the World Wide Web. The word "browser" seems to have originated prior to the Web
as a generic term for user interfaces that let you browse (navigate through and read) text files
online.
9
Technically, a Web browser is a client program that uses HTTP (Hypertext Transfer Protocol) to
make requests of Web servers throughout the Internet on behalf of the browser user. Most
browsers support e-mail and the File Transfer Protocol (FTP) but a Web browser is not required for
those Internet protocols and more specialized client programs are more popular.
-->
-------------------------------------------------------------------------
10
2.
3. a body, which contains the document's actual content. The body may be implemented by
the BODY element or the FRAMESET element.
White space (spaces, newlines, tabs, and comments) may appear before or after each section.
Sections 2 and 3 should be delimited by the HTML element.
Here's an example of a simple HTML document:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<TITLE>My first HTML document</TITLE>
</HEAD>
<BODY>
<P>Hello world!
</BODY>
</HTML>
------------------------------------------------------------------------------------------------------------------------
11
HTML Basics :
PAGE STRUCTURE
The head is used for text and tags that do not show directly on the page.
The body is used for text and tags that are shown directly on the page.
Finally, all webpages have an <html> tag at the beginning and the end, telling
the browser where the document starts and where it stops.
The most basic code - the code you will use for any page you make, is shown
below:
<html>
<head>
<!Thissectionisforthetitleandtechnicalinfoofthepage.>
</head>
<body>
<!Thissectionisforallthatyouwanttoshowonthepage.>
</body>
</html>
TAGS
As you can see, the start tag <b> indicates that whatever follows should be
12
written in bold. The corresponding end tag </b> indicates that the browser
should stop writing text in bold.
INTRODUCTION
Basically an HTML document is a plain text file that contains text and nothing
else.
When a browser opens an HTML file, the browser will look for HTML codes in
the text and use them to change the layout, insert images, or create links to
other pages.
Since HTML documents are just text files they can be written in even the
simplest text editor.
A more popular choice is to use a special HTML editor - maybe even one that
puts focus on the visual result rather than the codes - a so-called WYSIWYG
editor ("What You See Is What You Get").
Some of the most popular HTML editors, such as FrontPage or Dreamweaver
will let you create pages more or less as you write documents in Word or
whatever text editor you're using.
However, there are some very good reasons to create your own pages - or
parts of them - by hand...
WHY LEARN HTML?
You can read the code of other people's pages, and "borrow" the cool
effects.
You can do the work yourself, when the editor simply refuses to create
13
the effects you want.
You can write your HTML by hand with almost any available text editor,
including notepad that comes as a standard program with Windows.
All you need to do is type in the code, then save the document, making sure to
put an .html extension or an .htm extension to the file (for instance
"mypage.html").
HEAD SECTION
The head section of the webpage includes all the stuff that does not show
directly on the resulting page.
The <title> and </title> tags encapsulate the title of your page. The title is what
shows in the top of your browser window when the page is loaded.
Right now it should say something like "Basics - Html Tutorial" on top of the
window containing this text.
Another thing you will often see in the head section is metatags. Metatags are
used for, among other things, to improve the rankings in search engines.
Quite often the head section contains javascript which is a programming
language for more complex HTML pages.
Finally, more and more pages contain codes for cascading style sheets (CSS).
CSS is a rather new technique for optimizing the layout of major websites.
Since these aspects are way out of reach at this stage we will proceed with
explaining the body section.
HTML Basics :
BODY SECTION
The body of the document contains all that can be seen when the user loads
the page.
In the rest of this tutorial you can learn in detail about all the different aspects of
HTML, including:
Text
o
Formatting
Resizing
Layout
Listing
Links
14
To local pages
o To bookmarks
Images
o
Colors
Images
Fixed Image
Tables
Frames
Forms
Metatags
Hexadecimal Colors
The last page in this introduction will give you an overview of how to proceed
with the HTML tutorial (and beyond).