Web Technology Unit-2 Complete
Web Technology Unit-2 Complete
History of HTML –
Tim Berners-Lee, a physicist at the CERN research institute in Switzerland invented HTML in
1991. This first version consisted of 18 HTML tages. Now, there are currently about 140 HTML
tags, although not all of them are supported by modern browsers.
The Timline of HTML
1991- Tim Berners-Lee invents HTML 1.0
1993- HTML 1.0 is released. Not many developers are creating websites at this time.
1995- HTML 2.0 is published. This contains the features of HTML 1.0 plus new features.
This remained the standard markup language for designing and creating websites until
1997.
1997- HTML 3.0 was invented. Here, Dave Raggett introduced a fresh draft on HTML,
which improved new features of HTML and gave more powerful characteristics for
webmasters in designing websites. Unfortunately, the powerful features slowed down
the browser in applying further improvements.
1999- The widely-used HTML 4.0 comes out. It is very successful.
2014- HTML 5.0 is released and used worldwide. It is said to be the extended version of
HTML 4.01 which was published in 2012.
DHTML :-
DHTML stands for Dynamic Hypertext Markup language i.e., Dynamic HTML.
Dynamic HTML is not a markup or programming language but it is a term that combines the
features of various web development technologies for creating the web pages dynamic and
interactive.
The DHTML application was introduced by Microsoft with the release of the 4 th version of IE
(Internet Explorer) in 1997.
2. It is used for developing and creating 2. It is used for creating and designing the
web pages. animated and interactive web sites or pages.
3. This markup language creates static 3. This concept creates dynamic web pages.
web pages.
4. It does not contain any server-side 4. It may contain the code of server-side
scripting code. scripting.
5. The files of HTML are stored with the 5. The files of DHTML are stored with the
.html or .htm extension in a system. .dhtm extension in a system.
6. A simple page which is created by a 6. A page which is created by a user using the
user without using the scripts or styles HTML, CSS, DOM, and JavaScript technologies
called as an HTML page. called a DHTML page.
7. This markup language does not need 7. This concept needs database connectivity
database connectivity. because it interacts with users.
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>
Explaintion
The <!DOCTYPE html> declaration defines that this document is an HTML5 document
The <html> element is the root element of an HTML page
The <head> element contains meta information about the HTML page
The <title> element specifies a title for the HTML page (which is shown in the browser's
title bar or in the page's tab)
The <body> element defines the document's body, and is a container for all the visible
contents, such as headings, paragraphs, images, hyperlinks, tables, lists, etc.
The <h1> element defines a large heading
The <p> element defines a paragraph
Text Properties :-
Element Description
name
<b> This is a physical tag, which is used to bold the text written between it.
<strong> This is a logical tag, which tells the browser that the text is important.
<tt> This tag is used to appear a text in teletype. (not supported in HTML5)
<big> This tag is used to increase the font size by one conventional unit.
<small> This tag is used to decrease the font size by one unit from base font size.
Image Tag :
Images are not technically inserted into a web page; images are linked to web pages.
The <img> tag creates a holding space for the referenced image.
Note: Also, always specify the width and height of an image. If width and height are not
specified, the page might flicker while the image loads.
Syntax :
Web pages often contain multimedia elements of different types and formats.
Browser Support
The first web browsers had support for text only, limited to a single font in a single color.
Later came browsers with support for colors, fonts, images, and multimedia!
Multimedia Formats
The most common way to discover the type of a file, is to look at the file extension.
Multimedia files have formats and different extensions like: .wav, .mp3, .mp4, .mpg, .wmv, and
.avi.
HTML tags that fall under the category of "multimedia tags" are as follows:
HTML AUDIO Tag HTML VIDEO Tag HTML EMBED Tag HTML OBJECT Tag
The AUDIO tag is used to display the audio file on the web page. An audio file is a way for
devices like computers, MP3 players, and mobile phones to store audio data.
To store audio data, you need to convert it into a digital format. The process of converting
audio data into a digital file is called "encoding" of the raw audio data. It involves taking
samples of audio data and storing them in a compressed format to reduce the file size.
HTML5's AUDIO tag only supports the following three audio file formats:
.mp3: The most popular of the three audio file formats supported by the HTML AUDIO
tag is ".mp3." All web browsers support this audio file format.
.wav: IBM and Microsoft created the ".wav" audio file format. It works well on all
platforms, including Windows, Macintosh, and Linux.
.ogg: The Xiph.Org Foundation created the ".ogg" audio file format.
autoplay plays the audio file as soon as the web page loads.
controls displays the controls on the web page, such as play and pause buttons.
preload specifies whether the audio file is preloaded on the web page or not.
Consider the following example to learn how to embed audio files into your website.
<audio controls>
<source src="song.mp3" type="audio/mpeg">
The AUDIO tag is not supported by your browser.
</audio>
When the AUDIO tag is not supported by the web browser, the text between the AUDIO tag is
displayed. Because the text "The AUDIO tag is not supported by your browser." is available
between the AUDIO tag in the above code fragment, it will be displayed if the AUDIO tag is not
supported by the web browser.
You can provide multiple audio sources in multiple file formats. For example:
<audio controls>
<source src="song.ogg" type="audio/ogg">
<source src="song.mp3" type="audio/mpeg">
The AUDIO tag is not supported by your browser.
</audio>
The "controls" attribute adds audio controls like play, pause, and volume.
The "VIDEO" tag, like "AUDIO," is used to display video files on a web page.
.mp4: This video file format has been developed by the "Moving Pictures Expert Group."
This video file format is recommended by one of the biggest video sharing platforms,
YouTube.
.webm: This video file format has been developed by web giants Mozilla, Opera, Adobe,
and Google.
.ogg: The Xiph.Org Foundation created the ".ogg" video file format.
autoplay plays the audio file as soon as the web page loads.
controls displays the controls on a web page, such as play and pause buttons.
preload specifies whether the video file is preloaded on the web page or not.
poster provides an image to be displayed when the video file is not available.
To provide the source of the video file, you can also use the SOURCE tag within the opening and
closing tags of the VIDEO tag.
When the location of the video file cannot be determined, the SOURCE tag is used. In this case,
the VIDEO tag plays the first video file found in the specified path. The VIDEO tag is
demonstrated in the following code snippet:
In the src attribute of the preceding code snippet, we defined a video.ogv file. We've also set
the autoplay attribute to true, which means the video will begin playing as soon as the web
page loads. Because the loop attribute is set to 3, the video file will be played three times.
Furthermore, the controls attribute shows the controls on the video player.
Consider the following example to learn how to embed video into your website.
HTML allows you to embed plug-ins in a web page using the EMBED tag. This tag lets you
embed multimedia in a web page and play it while opening the page.
The EMBED tag uses the three mandatory attributes, namely src, height, and width.
Attribute Description
height specifies the height of the embedded component.
specifies the Multipurpose Internet Mail Extension (MIME) type for the
type
components.
In the previous example, we used the src attribute to tell the browser which multimedia file to
play while the web page loads. We have also defined the height and width attributes to specify
the height and width of the embedded multimedia component on the page, respectively.
Objects like images, sounds, videos, Java applets, ActiveX controls, Portable Document Format
(PDF), and Flash objects can be added to a web page using the HTML OBJECT tag.
An object tag can also be used inside the body tag. The text between the starting and ending
tags of the OBJECT tag is the alternate text for browsers that do not support this tag.
Attribute Description
The OBJECT tag initializes the object by passing the parameters to the object, which can be
done using the PARAM tag.
In HTML, you can use the PARAM tag to define parameters or variables for an OBJECT tag. An
OBJECT tag can contain multiple PARAM tags, as shown in the following code snippet.
In the above code snippet, we have defined an OBJECT tag, which includes a video file in a web
page. We have also used the PARAM tags to pass the parameters for the OBJECT tag.
The following table shows the various attributes of the PARAM tag.
Attribute Description
HTML Links
HTML links or hyperlinks connect one resource on the web to another. The resource may be an
image, a web page, a program, a video clip, an audio clip, an element within a web page, etc, or
anything that can be hosted on the internet.
We use the HTML <a> tag to create hyperlinks. The syntax for the <a> tag is
Here,
Clicking on the text will navigate you to the resource in the URL.
Input :
<!DOCTYPE html>
<html>
<h3>Example
h3>Example Of Adding a link</h3>
<body>
<a href="https://www.geeksforgeeks.org
https://www.geeksforgeeks.org">GeeksforGeeks</a>
</body>
</html>
Output :
HTML Lists
Unordered List
The unordered list is used to represent data in a list for which the order of items does not
matter.
In HTML, we use the <ul> tag to create unordered lists. Each item of the list must be a <li> tag
which represents list items. For example,
<ul>
<li>Apple</li>
<li>Orange</li>
<li>Mango</li>
</ul>
Browser Output
Ordered List
The ordered list is used to represent data in a list for which the order of items has significance.
The <ol> tag is used to create ordered lists. Similar to unordered lists, each item in the ordered
list must be a <li> tag. For example,
<ol>
<li>Ready</li>
<li>Set</li>
<li>Go</li>
</ol>
Browser Output
Description List
<dl>
<dt>HTML</dt>
<dd>Hyper-Text
Text Markup Language</dd>
<dt>CSS</dt>
<dd>Cascading StyleSheets</dd>
<dt>JS</dt>
<dd>Javascript</dd>
</dl>
Browser Output
Tag Explanation
HTML Table
The HTML tables allow web authors to arrange data like text, images, links, other tables, etc.
into rows and columns of cells.
The HTML tables are created using the <table> tag in which the <tr> tag is used to create table
rows and <td> tag is used to create data cells. The elements under <td> are regular and left
aligned by default
Example
<!DOCTYPE html>
<html>
<head>
<title>HTML Tables</title>
</head>
<body>
<table border = "1">
<tr>
<td>Row 1, Column 1</td>
<td>Row 1, Column 2</td>
</tr>
<tr>
<td>Row 2, Column 1</td>
<td>Row 2, Column 2</td>
</tr>
</table>
</body>
</html>
Here, the border is an attribute of <table> tag and it is used to put a border across all the cells. If you do
not need a border, then you can use border = "0".
<col> It is used with <colgroup> element to specify column properties for each
column.
Tag Description
Example:
1. <form>
2. <label for="name">Enter name
name</label><br>
3. <input type="text" id="name"
"name" name="name"><br>
4. <label for="pass">Enter Password
Password</label><br>
5. <input type="Password" id="pass"
"pass" name="pass"><br>
6. <input type="submit" value="submit"
"submit">
7. </form>
Output:
HTML Layouts
Web page layout is the most important part to keep in mind while creating a website so that
our website can appear professional with the great look. You can also use CSS and JAVASCRIPT
based frameworks for creating layouts for responsive an
andd dynamic website designing.
HTML Layout Elements
<header> - Defines a header for a document or
a section
<nav> - Defines a set of navigation links
<section> - Defines a section in a document
<article> - Defines an independent, self-
contained content
<aside> - Defines content aside from the
content (like a sidebar)
<footer> - Defines a footer for a document or
a section
<details> - Defines additional details that the
user can open and close on demand
<summary> - Defines a heading for
the <details> element
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
content="width=device-width,
initial-scale=1,
maximum-scale=1">
<meta name="description"
content="A Computer Science portal for geeks.It contains well written, well thought
and well explained computer science and programming articles,practice/ competitive
programming/company interview Questions.">
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
</head>
<body>
<h2>GeeksforGeeks</h2>
<p>This is an example of meta tag</p>
</body>
</html>
Output:
Browser Architecture
The browser’s main functionality is to fetch the file from the server and to display them on the
screen.it basically displays HTML files containing images, PDF, videos, flashes, etc in an ordered
layout.
User interface:
The user interface is the space where interaction between users and the browser occurs. Most
of the browsers have common inputs for the user interface. Some of them are an address bar,
next and back button, home button, refresh and stop button, etc.
Browse Engine:
It is the peace of code that communicates the inputs of the user interface with the rendering
engine. It is responsible for querying and manipulating the rendering engine according to the
inputs from various user interfaces.
Rendering Engine:
It is the part thoroughly responsible for displaying the requested content on the screen. It first
parses the HTML tags and then using the styles, it deals with a render tree and finally a render
layout that displays the content on the screen.
Networking:
The function of the code written in the browser is responsible to sent various network calls. For
example, sending the HTTP request to the server.
JavaScript Interceptor:
It is the component of the browsers written to interpret the javascript code presented on a web
page.
UI Backend:
This draws basic widgets on the browser like combo boxes, windows, etc. The rendering engine
uses the UI backend layer during the layout and painting stages to display the web page on the
browser.
Data Persistence:
It is a small database created on the local file system of the computer where the browser is
installed. The database stores various files like Cache, Cookies etc.
HTML 5
HTML5 is a next version of HTML. Here, you will get some brand new features which will make
HTML much easier. These new introducing features make your website layout clearer to both
website designers and users. There are some elements like <header>, <footer>, <nav> and
<article> that define the layout of a website.
Features of HTML 5:
It has introduced new multimedia features which supports both audio and video
controls by using <audio> and <video> tags.
There are new graphics elements including vector graphics and tags.
Enrich semantic content by including <header> <footer>, <article>, <section> and
<figure> are added.
Drag and Drop- The user can grab an object and drag it further dropping it to a new
location.
Geo-location services- It helps to locate the geographical location of a client.
Web storage facility which provides web application methods to store data on the web
browser.
Uses SQL database to store data offline.
Allows drawing various shapes like triangle, rectangle, circle, etc.
Capable of handling incorrect syntax.
Easy DOCTYPE declaration i.e., <!doctype html>
Easy character encoding i.e., <meta charset=”UTF-8″>