HTML 1
HTML 1
Basics
Hyper Text markup Language
History
• HTML was created by Berners-Lee in late 1991 but "HTML 2.0" was
the first standard HTML specification which was published in 1995.
HTML 4.01 was a major version of HTML and it was published in late
1999. Though HTML 4.01 version is widely used but currently we are
having HTML-5 version which is an extension to HTML 4.01, and this
version was published in 2012.
HTML
• HTML, the markup language behind virtually every page of the World Wide Web
• Not a programming language, it is a markup language
• Mark up our text documents so that web browsers know how to display them
and to define hypertext links within them to provide navigation within or
between them
• Uses markup tags to describe web pages
• Tool
• HTML markup employ only ordinary keyboard characters, all you really need is a good
text editor to construct HTML pages
• Notepad
• Dreamweaver
• Provides line numbering and syntax highlighting
What is HTML?
• HTML is a language for describing web pages.
• 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
• The text between <h1> and </h1> describes a heading
• The text between <p> and </p> describes a paragraph
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:
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title> A Simple HTML Document </title>
</head>
<body>
<h1>My HTML Page</h1>
Welcome to my first page written in HTML.<br />
This is simply a text document with HTML markup to show some
words in <b>bold</b> and some other words in <i>italics</i>.
<br />
</body>
</html>
HTML
HTML Page Structure
HTML
• DOCTYPE element
• notify the browser of the “flavor” of HTML used in the document
• HTML 4.0 Transitional, a fairly forgiving version of the HTML specification that allows the use of some
earlier markup styles and structures in addition to the latest HTML 4.0 specifications
• <head> …</head>
• the document’s head section is used to store information about the document that is not to be
displayed in the browser window
• <title>…</title>
• the document title fulfils a number of functions, among them:
• Search engines often use the page title (among other factors) to help them decide what a page is about
• When you bookmark a page, it is generally saved by default as the document
• Title
• Most browsers, when minimized, display the title of the current document on their icon or taskbar button
• link, meta, and script elements
HTML
• <body>…</body>
• body of the document contains text to be interpreted and displayed to the user via the browser window
• Bold
• Italics
• Headings
• Line break
• Horizontal line
• Adding Attributes to HTML Tags
<body bgcolor=”#cccccc”>
… page content goes here …
</body>
• Images
<img src=”myimagefile.jpg” border=”2” width=”250” height=”175” />
• alt=”Description of Image”
• Tables
• <table>
• Hyperlinks
• A hyperlink can contain images as well as text
HTML Basic Examples
• All HTML documents must start with a type declaration: <!DOCTYPE html>.
• The HTML document itself begins with <html> and ends with </html>.
• The visible part of the HTML document is between <body> and </body>.
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
HTML Headings
<html>
<body>
</body>
</html>
HTML Headings
• Headings are defined with the <h1> to <h6> tags.
• <h1> defines the most important heading. <h6> defines the least
important heading.
Headings Are Important
• Use HTML headings for headings only. Don't use headings to make
text BIG or bold.
• Search engines use your headings to index the structure and content
of your web pages.
• Users skim your pages by its headings. It is important to use headings
to show the document structure.
• h1 headings should be main headings, followed by h2 headings, then
the less important h3, and so on.
HTML Horizontal Rules
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
</body>
</html>
HTML Display(Formatting and Fonts)
• You cannot be sure how HTML will be displayed.
• Large or small screens, and resized windows will create different
results.
• With HTML, you cannot change the output by adding extra spaces or
extra lines in your HTML code.
• The browser will remove extra spaces and extra lines when the page
is displayed.
• Any number of spaces, and any number of new lines, count as only
one space.
HTML Paragraphs
• HTML Display
• You cannot be sure how HTML will be displayed.
• Large or small screens, and resized windows will create different results.
• With HTML, you cannot change the output by adding extra spaces or
extra lines in your HTML code.
• The browser will remove extra spaces and extra lines when the page is
displayed.
• Any number of spaces, and any number of new lines, count as only one
space.
Example
<br>
HTML Attributes
• Attributes provide additional information about HTML elements.
• HTML Attributes
• HTML elements can have attributes
• Attributes provide additional information about an element
• Attributes are always specified in the start tag
• Attributes come in name/value pairs like: name="value"
Example of Attributes
• The title Attribute
• HTML paragraphs are defined with the <p> tag.
• In this example, the <p> element has a title attribute. The value of the
attribute is "About W3Schools":
HTML Attributes
• Below is an alphabetical list of some attributes often used in HTML:
Attribute Description
This is superscript
HTML Formatting Elements
In the previous slide, you learned about HTML styling, using the
HTML style attribute.
HTML also defines special elements, for defining text with a
special meaning.
HTML uses elements like <b> and <i> for formatting output,
like bold or italic text.
Formatting elements were designed to display special types of text:
Home Task
• Bold text <b>
• Important text <strong>
• Italic text <i>
• Emphasized text <em>
• Marked text <mark>
• Small text <small>
• Deleted text <del>
• Inserted text <ins>
• Subscripts <sub>
• Superscripts <sup>
HTML Comments
• you can add comments to your HTML source by using the following
syntax:
<html>
<body>
<!-- This is a comment -->
<p>This is a paragraph.</p>
<!-- Comments are not displayed in the browser -->
</body>
</html>
HTML Comments
Note: There is an exclamation point (!) in the opening tag, but not in
the closing tag.
Comments are not displayed by the browser, but they can help
document your HTML.
With comments you can place notifications and reminders in your
HTML:
Test
• Validation service ( validator.w3.org )
– Checking a document’s syntax
• URL that specifies the location of the file
• Uploading a file to the site
• http://validator.w3.org/#validate_by_upload
Home Task
• Made report on Marquee Tag.
• Resource
• http://www.w3schools.com
• http://www.tutorialspoint.com