HTML
HTML
HTML
What is HTML
HTML is stands for Hyper Text Markup Language which is used for creating web
pages and web applications.
Hyper Text: HyperText simply means "Text within Text." A text has a link within it,
is a hypertext. Whenever you click on a link which brings you to a new webpage,
you have clicked on a hypertext. HyperText is a way to link two or more web pages
(HTML documents) with each other.
http://info.cern.ch/hypertext/WWW/TheProject.html
HTML 1.0: The first version of HTML was 1.0, which was the barebones version of
HTML language, and it was released in 1991.
HTML 2.0: This was the next version which was released in 1995, and it was
standard language version for website design. HTML 2.0 was able to support extra
features such as form-based file upload, form elements such as text box, option
button, etc.
HTML 3.2: HTML 3.2 version was published by W3C in early 1997. This version
was capable of creating tables and providing support for extra options for form
elements. It can also support a web page with complex mathematical equations. It
became an official standard for any browser till January 1997. Today it is
practically supported by most of the browsers.
HTML 4.01: HTML 4.01 version was released on December 1999, and it is a very
stable version of HTML language. This version is the current official standard, and
it provides added support for stylesheets (CSS) and scripting ability for various
multimedia elements.
HTML5 : HTML5 is the newest version of HyperText Markup language. The first
draft of this version was announced in January 2008. There are two major
organizations one is W3C (World Wide Web Consortium), and another one is
WHATWG( Web Hypertext Application Technology Working Group) which are
involved in the development of HTML 5 version, and still, it is under development.
Features of HTML
It is a very easy and simple language. It can be easily understood and modified.
It is very easy to make an effective presentation with HTML because it has a lot of
formatting tags.
It is a markup language, so it provides a flexible way to design web pages along with
the text.
● An HTML file is a text file, so to create an HTML file we can use any text editors.
● Text editors are the programs which allow editing in a written text, hence to
create a web page we need to write our code in some text editor.
● There are various types of text editors available which you can directly download,
but for a beginner, the best text editor is Notepad (Windows) or TextEdit (Mac).
● After learning the basics, you can easily use other professional text editors
which are, Notepad++, Sublime Text, Vim, etc.
Building Blocks of HTML
● Tags: An HTML tag surrounds the content and apply meaning to it. It is
written between < and > brackets.
<html>
<head>
</head>
<body>
</body>
</html>
** Save as buildingblocks.html
HTML Tags
HTML tags are like keywords which defines that how web browser will format and
display the content. With the help of tags, a web browser can distinguish between
an HTML content and a simple content. A start tag consists of an opening angle
bracket (<) followed by the element name, zero or more space separated
attribute/value pairs, and a closing angle bracket (>).
End tags consist of an opening angle bracket followed by a forward slash, the
element name, and a closing angle bracket:
When a web browser reads an HTML document, browser reads it from top to
bottom and left to right. HTML tags are used to create HTML documents and
render their properties. Each HTML tags have different properties.
● All HTML tags must enclosed within < > these brackets.
● Every tag in HTML perform different tasks.
● If you have used an open tag <tag>, then you must use a
close tag </tag> (except some tags)
Example
<!DOCTYPE html>
<html>
<body>
<p> Paragraph Tag </p>
<h2> Heading Tag </h2>
<b> Bold Tag </b>
<i> Italic Tag </i>
<u> Underline Tag</u>
<hr>
</body>
</html>
**Save as tags.html
Attributes
● HTML attributes are special words which provide additional information
about the elements or attributes are the modifier of the HTML element.
Core Attributes
● Id
● Title
● Class
● Style
The id attribute of an HTML tag can be used to uniquely identify any element
within an HTML page.
Example:
Example:
The class attribute is used to associate an element with a style sheet, and
specifies the class of element.
The style attribute allows you to specify Cascading Style Sheet (CSS) rules within
the element.
Syntax :
<!-- This is body section, write code here which you want to display on web-page -->
<body>
<!-- heading tag -->
<h2>My WebPage</h2>
<html>
<body>
</body>
</html>
HTML Anchor
The HTML anchor tag defines a hyperlink that links one page to another page. It
can create hyperlink to other web page as well as files, location, or any URL. The
"href" attribute is the most important attribute of the HTML a tag. and which links
to destination page or URL.
Syntax:
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
HTML Images
HTML img tag is used to display image on the web page. HTML img tag is an
empty tag that contains attributes only, closing tags are not used in HTML image
element.
We can create a table to display data in tabular form, using <table> element, with
the help of <tr> , <td>, and <th> elements.
In Each table, table row is defined by <tr> tag, table header is defined by <th>, and
table data is defined by <td> tags.
HTML tables are used to manage the layout of the page e.g. header section,
navigation bar, body content, footer section etc. But it is recommended to use div
tag over table to manage the layout of the page .
<!DOCTYPE html>
<html>
<body>
<table>
<tr><th>First_Name</th><th>Last_Name</th><th>Marks</th></tr>
<tr><td>Sonoo</td><td>Jaiswal</td><td>60</td></tr>
<tr><td>James</td><td>William</td><td>80</td></tr>
<tr><td>Swati</td><td>Sironi</td><td>82</td></tr>
<tr><td>Chetna</td><td>Singh</td><td>72</td></tr>
</table>
</body>
</html>
HTML Lists
HTML Lists are used to specify lists of information. All lists may contain one or
more list elements. There are three different types of HTML lists:
In the ordered HTML lists, all the list items are marked with numbers by default. It
is known as numbered list also. The ordered list starts with <ol> tag and the list
items start with <li> tag.
HTML Ordered List or Numbered List Example
<!DOCTYPE html>
<html>
<body>
<ol>
<li>Aries</li>
<li>Bingo</li>
<li>Leo</li>
<li>Oracle</li>
</ol>
</body>
</html>
HTML Ordered List or Numbered List Types:
<ol type="I">
<ol type="i">
<ol type="A">
<ol type="a">
HTML Unordered List or Bulleted List
In HTML Unordered list, all the list items are marked with bullets. It is also known
as bulleted list also. The Unordered list starts with <ul> tag and list items start with
the <li> tag.
HTML Unordered List or Bulleted List Example
<!DOCTYPE html>
<html>
<body>
<ul>
<li>Aries</li>
<li>Bingo</li>
<li>Leo</li>
<li>Oracle</li>
</ul>
</body>
</html>
HTML Unordered List or Bulleted List Types
<ul type="circle">
<ul type="square">
<ul type="none">
HTML Description List or Definition List
The definition list is very appropriate when you want to present glossary, list of
terms or other name-value list.
<!DOCTYPE html>
<html>
<body>
<dl>
<dt>Aries</dt>
<dd>-One of the 12 horoscope sign.</dd>
<dt>Bingo</dt>
<dd>-One of my evening snacks</dd>
<dt>Leo</dt>
<dd>-It is also an one of the 12 horoscope sign.</dd>
</dl>
</body>
</html>
HTML Forms
An HTML form is a section of a document which contains controls such as text
fields, password fields, checkboxes, radio buttons, submit button, menus etc.
An HTML form facilitates the user to enter data that is to be sent to the server for
processing such as name, email address, password, phone number, etc. .
Why HTML Forms
HTML forms are required if you want to collect some data from of the site visitor.
For example: If a user want to purchase some items on internet, he/she must fill
the form such as shipping address and credit/debit card details so that item can
be sent to the given address.
Syntax:
</form>
HTML Form Controls
● Text Input Controls
● Checkboxes Controls
● Hidden Controls
● Clickable Buttons
<!DOCTYPE html>
<html>
<head>
<title>Text Input Control</title>
</head>
<body>
<form >
First name: <input type = "text" name = "first_name" /> <br>
Last name: <input type = "text" name = "last_name" />
</form>
</body>
</html>