Web Unit 1 (Nep)
Web Unit 1 (Nep)
Unit I
Introduction and web design:
Introduction to internet:
History of Internet
In the 1960s, the U.S. Department of Defense (DoD) became interested in developing a new
large-scale computer network. The purposes of this network were communications, program
sharing, and remote computer access for researchers working on defense-related contracts. One
fundamental requirement was that the network be sufficiently robust so that even if some
network nodes were lost to sabotage, war, or some more benign cause, the network would
continue to function. The DoD‘s Advanced Research Projects Agency (ARPA) funded the
construction of the first such network. Because it was funded by ARPA, the network was
named ARPAnet. Because ARPAnet was available only to laboratories and universities that
conducted ARPA-funded research, the great majority of educational institutions were not
connected. As a result, a number of other networks were developed during the late 1970s and
early 1980s, with BITNET (Because It‘s Time Network) and CSNET (Computer Science
Network) among them. A new national network, NSFnet, was created in 1986. It was
sponsored, of course, by the National Science Foundation (NSF). 1992 NSFnet connected more
than 1 million computers around the world. In 1995, a small part of NSFnet returned to being a
research network. The rest became known as the Internet.
Internet
The Internet is a huge collection of autonomous devices (Computers, Printers, Mobile Phones,
Smart TV, etc) connected in a communications network. Internet is actually a network of
networks. The innovation that allows all of these diverse devices to communicate with each
other is a single, low-level protocol: the Transmission Control Protocol/Internet Protocol
(TCP/IP).
The most commonly cited examples of Web 2.0 applications include Facebook, X, Instagram,
or Tiktok. These sites allow users to interact with web pages instead of simply viewing them.
Web Browsers
NANDINI S D, GFGCW, H N PURA Page 1
WEB TECHNOLOGIES (6TH SEM BSc)(NEP)
A web browser takes you anywhere on the internet. It retrieves information from other parts of
the web and displays it on your desktop or mobile device. The information is transferred using
the Hypertext Transfer Protocol, which defines how text, images and video are transmitted on
the web.
Google Chrome, Microsoft Edge, Mozilla Firefox, and Safari are examples of web browsers.
Web server
A web server is software and hardware that uses HTTP (Hypertext Transfer Protocol) and other
protocols to respond to client requests made over the World Wide Web. The main job of a web
server is to display website content through storing, processing and delivering webpages to
users.
There are many web servers available in the market both free and paid. Some of them are
described below:
1. Apache HTTP server: It is the most popular web server and about 60 percent of the
world’s web server machines run this web server. The Apache HTTP web server was
developed by the Apache Software Foundation. It is an open-source software which means
that we can access and make changes to its code and mold it according to our preference. The
Apache Web Server can be installed and operated easily on almost all operating systems like
Linux, MacOS, Windows, etc.
3. Lighttpd: Lighttpd is pronounced as ‘Lightly’. It currently runs about 0.1 percent of the
world’s websites. Lighttpd has a small CPU load and is therefore comparatively easier to run.
It has a low memory footprint and hence in comparison to the other web servers, requires less
memory space to run which is always an advantage. It also has speed optimizations which
means that we can optimize or change its speed according to our requirements. It is an open-
source software which means that we can access its code and add changes to it according to
our needs and then upload our own module (the changed code)
4. Jigsaw Server: Jigsaw has been written in the Java language and it can run CGI (common
gateway interference) scripts as well as PHP programs. It is not a full-fledged server and was
developed as an experimental server to demonstrate the new web protocols. It is an open-
source software which means that we can access its code and add changes to it according to
NANDINI S D, GFGCW, H N PURA Page 3
WEB TECHNOLOGIES (6TH SEM BSc)(NEP)
our needs and then upload our own module (the changed code). It can be installed on any
device provided that the device supports Java language and modifications in Java.
5. Sun Java System: The Sun Java System supports various languages, scripts, and
technologies required for Web 2.0 such as Python, PHP, etc. It is not an open-source software
and therefore its code is inaccessible which means that we cannot make changes in the code to
suit our needs
Internet Protocol
Internet Protocols are a set of rules that governs the communication and exchange of data over
the internet. Both the sender and receiver should follow the same protocols in order to
communicate the data. In order to understand it better, let’s take an example of a language.
Any language has its own set of vocabulary and grammar which we need to know if we want
to communicate in that language. Similarly, over the internet whenever we access a website or
exchange some data with another device then these processes are governed by a set of rules
called the internet protocols.
Working of Internet Protocol
The internet and many other data networks work by organizing data into small pieces called
packets. Each large data sent between two network devices is divided into smaller packets by
the underlying hardware and software. Each network protocol defines the rules for how its
data packets must be organized in specific ways according to the protocols the network
supports.
Need of Protocols
It may be that the sender and receiver of data are parts of different networks, located in
different parts of the world having different data transfer rates. So, we need protocols to
manage the flow control of data, and access control of the link being shared in the
communication channel. Suppose there is a sender X who has a data transmission rate of 10
Mbps. And, there is a receiver Y who has a data receiving rate of 5Mbps. Since the rate of
receiving the data is slow so some data will be lost during transmission. In order to avoid this,
receiver Y needs to inform sender X about the speed mismatch so that sender X can adjust its
transmission rate. Similarly, the access control decides the node which will access the link
shared in the communication channel at a particular instant in time. If not the transmitted data
will collide if many computers send data simultaneously through the same link resulting in the
corruption or loss of data.
What is IP Addressing?
An IP address represents an Internet Protocol address. A unique address that identifies the
device over the network. It is almost like a set of rules governing the structure of data sent
over the Internet or through a local network. An IP address helps the Internet to distinguish
between different routers, computers, and websites. It serves as a specific machine identifier
in a specific network and helps to improve visual communication between source and
destination
over the internet and how it should be broken into IP packets. It also makes sure that the
packets have information about the source of the message data, the destination of the message
data, the sequence in which the message data should be re-assembled, and checks if the
message has been sent correctly to the specific destination. The TCP is also known as a
connection-oriented protocol.
For more details, please refer TCP/IP Model article.
a user opens their web browser, the user will indirectly use HTTP as this is the protocol that
is being used to share text, images, and other multimedia files on the World Wide Web.
Note: Hypertext refers to the special format of the text that can contain links to other texts.
8. TELNET(Terminal Network)
TELNET is a standard TCP/IP protocol used for virtual terminal service given by ISO. This
enables one local machine to connect with another. The computer which is being connected is
called a remote computer and which is connecting is called the local computer. TELNET
operation lets us display anything being performed on the remote computer in the local
computer. This operates on the client/server principle. The local computer uses the telnet
client program whereas the remote computer uses the telnet server program.
10. IPv4
The fourth and initially widely used version of the Internet Protocol is called IPv4 (Internet
Protocol version 4). It is the most popular version of the Internet Protocol and is in charge of
distributing data packets throughout the network. Maximum unique addresses for IPv4 are
4,294,967,296 (232), which are possible due to the use of 32-bit addresses. The network
address and the host address are the two components of each address. The host address
identifies a particular device within the network, whereas the network address identifies the
network to which the host belongs. In the “dotted decimal” notation, which is the standard for
IPv4 addresses, each octet (8 bits) of the address is represented by its decimal value and
separated by a dot (e.g. 192.168.1.1).
11. IPv6
The most recent version of the Internet Protocol, IPv6, was created to address the IPv4
protocol’s drawbacks. A maximum of 4.3 billion unique addresses are possible with IPv4’s
32-bit addresses. Contrarily, IPv6 uses 128-bit addresses, which enable a significantly greater
number of unique addresses. This is significant because IPv4 addresses were running out and
there are an increasing number of devices that require internet access. Additionally, IPv6
offers enhanced security features like integrated authentication and encryption as well as
better support for mobile devices. IPv6 support has spread among websites and internet
service providers, and it is anticipated to gradually displace IPv4 as the main internet
protocol.
For more details, please refer Differences between IPv4 and IPv6 article.
12. ICMP
ICMP (Internet Control Message Protocol) is a network protocol that is used to send error
messages and operational information about network conditions. It is an integral part of the
Internet Protocol (IP) suite and is used to help diagnose and troubleshoot issues with network
connectivity. ICMP messages are typically generated by network devices, such as routers, in
response to errors or exceptional conditions encountered in forwarding a datagram. Some
examples of ICMP messages include:
Echo Request and Echo Reply (ping)
Destination Unreachable
Time Exceeded
Redirect
ICMP can also be used by network management tools to test the reachability of a host and
measure the round-trip time for packets to travel from the source to the destination and back.
It should be noted that ICMP is not a secure protocol, it can be used in some types of network
attacks like DDoS amplification.
13. UDP
UDP (User Datagram Protocol) is a connectionless, unreliable transport layer protocol.
Unlike TCP, it does not establish a reliable connection between devices before transmitting
data, and it does not guarantee that data packets will be received in the order they were sent
or that they will be received at all. Instead, UDP simply sends packets of data to a destination
without any error checking or flow control. UDP is typically used for real-time applications
such as streaming video and audio, online gaming, and VoIP (Voice over Internet
Protocol) where a small amount of lost data is acceptable and low latency is important. UDP
NANDINI S D, GFGCW, H N PURA Page 8
WEB TECHNOLOGIES (6TH SEM BSc)(NEP)
is faster than TCP because it has less overhead. It doesn’t need to establish a connection, so it
can send data packets immediately. It also doesn’t need to wait for confirmation that the data
was received before sending more, so it can transmit data at a higher rate.
14. IMAP
IMAP (Internet Message Access Protocol) is a protocol used for retrieving emails from a
mail server. It allows users to access and manage their emails on the server, rather than
downloading them to a local device. This means that the user can access their emails from
multiple devices and the emails will be synced across all devices. IMAP is more flexible
than POP3 (Post Office Protocol version 3) as it allows users to access and organize their
emails on the server, and also allows multiple users to access the same mailbox.
15. SSH
SSH (Secure Shell) is a protocol used for secure remote login and other secure network
services. It provides a secure and encrypted way to remotely access and manage servers,
network devices, and other computer systems. SSH uses public-key cryptography to
authenticate the user and encrypt the data being transmitted, making it much more secure
than traditional remote login protocols such as Telnet. SSH also allows for secure file
transfers using the SCP (Secure Copy) and SFTP (Secure File Transfer Protocol) protocols. It
is widely used in Unix-based operating systems and is also available for Windows. It is
commonly used by system administrators, developers, and other technical users to remotely
access and manage servers and other network devices.
16. Gopher
Gopher is a type of file retrieval protocol that provides downloadable files with some
description for easy management, retrieving, and searching of files. All the files are arranged
on a remote computer in a stratified manner. It is an old protocol and it is not much used
nowadays.
Balance
Balance simply means visual harmony. Good balance is like trying to create a Visual
Harmony on your website. For example, avoiding one side of the website from having all the
information when the other side has almost nothing. Balance can be measured in three forms:
symmetrically, asymmetrically and radially.
Note:- Next four practices are together called C.R.A.P. (Contrast, Repetition, Alignment,
Proximity)
Alignment
Alignment is the way in which elements are placed on the website. The most common usage
of alignment is with text alignment, making the text written left, center, right or justify align.
But alignment is more than just about text alignment, it is also used to add interest into your
design. designers use alignment to add creativity to their designs. Good alignment ensures
proper readability which in turn ensures good communication of your message.
Proximity
Proximity of elements means how close the elements are to other elements. the primary use
of proximity Is for creating relationships between elements, like objects go together and
distantly related objects are further away from each other. Proximity is the design principle
designers are often referring to when they speak about white space in the design, so
proximity like white space helps your elements breathe and make sections distinct from one
another. bad proximity can have negative effects on your website.
Repetition
Repetition is basically creating a pattern in user’s mind looking at the user interface.
Repetition is all about the consistency and the unity of the design in trying to create a
cohesion between all the elements. Repetition is probably the most used in naturally intuitive
design principle. It is extremely unlikely that a website doesn’t even have the modest amount
of repetition. The most obvious example of repetition is typography, think about it, every
paragraph is designed the same font size, every H1 heading should look like every other H1
heading and every H2 heading should look like every other H2 heading and so on, this ends
up creating a cohesion. Repetition also helps in creating brand, style, consistency, a better
user experience and of course repetition. Repetition should be consistent throughout a
website’s typography, sets of buttons, stylings, spacings and very importantly header and
footer.
Contrast
Contrast is a design principle where we try and differentiate one or more elements/visuals
from others by differentiating them by help of colors, fonts, typography, repetition,
alignment, or anything else. The idea is to make a particular element or visual to stand out to
the users. In design terms – The visual design principle of contrast refers to the juxtaposition
of two visually different elements. Contrast is when you notice the difference between two
objects in the user interface and that difference emphasizes that they are different. This
distinction might mean that they belong to different categories or have different functions or
behave differently etc.
Accessibility
Accessibility is designing products services (in our case, it’s designing UI/UX) and
environments in an all-inclusive manner. In simpler terms, it means designing for everybody,
keeping in mind the people who might have some special needs and taking care of those
needs in the product experience and interface.
For example you can create a new feature of listening to news in your social media app and
improve its accessibility by also providing the transcript in some commonly used languages
so that the feature becomes accessible to people with hearing issues.
Design thinking
Design thinking is basically a creative way to solve problems. It is the sum of all the
processes that results in designing of a prototype, The most important skills for design
thinking are – having empathy for the users and prototyping.
Design thinking involves five main steps:
understand the challenge
defining the problem.
coming up with solutions
creating a prototype
test the prototype and iterate.
Design differs from art in that it has to have a purpose. Visually, this functionality is interpreted
by making sure an image has a center of attention, a point of focus.
Step 1: Design. This is the fun part. ...
Step 2: Review. Once the team has had some time to work through the design process. ...
Step 3: Develop. Now that the design is approved, it is time for the website to go to the
developer. ...
Step 4: Test. ...
Step 5: Launch!
How the browser interacts with the servers ? There are few steps to follow to interacts with
the servers a client.
User enters the URL(Uniform Resource Locator) of the website or file. The Browser then
requests the DNS(DOMAIN NAME SYSTEM) Server.
DNS Server lookup for the address of the WEB Server.
DNS Server responds with the IP address of the WEB Server.
Browser sends over an HTTP/HTTPS request to WEB Server’s IP (provided by DNS
server).
Server sends over the necessary files of the website.
Browser then renders the files and the website is displayed. This rendering is done with the
help of DOM (Document Object Model) interpreter, CSS interpreter and JS
Engine collectively known as the JIT or (Just in Time) Compilers.
The client-side programming languages are HTML, CSS, and JavaScript. In contrast, server-
side scripting programming languages, including PHP, ColdFusion, Python, ASP.net, Java,
C++, Ruby, C#, A server-side script communicates with the server when it is executed.
Markup languages like HTML and CSS are interpreted by the browser on the client side
MIME
Multipurpose Internet Mail Extensions (MIME) is an Internet standard that extends the format
of email messages to support text in character sets other than .
There are three basic styles in the two types of mime: Oriental, Italian, and French. The Oriental
style is very elaborate, employing wigs, detailed makeup, props, and music. Usually stock
characters familiar to the audience are portrayed. Oriental mime also includes exciting
gymnastic movements.
There are two basic types of mime—literal and abstract. Literal mime is the best-known form. It
tells a story, usually humorous, in such a way that the audience knows exactly how to interpret
the plot. In abstract mime there often is no plot at all.
Search engine:
A search engine is a software system that provides hyperlinks to web pages and other relevant
information on the Web in response to a user's query. The user inputs a query within a web
browser or a mobile app, and the search results are often a list of hyperlinks, accompanied by
textual summaries and images. Users also have the option of limiting the search to a specific
type of results, such as images, videos, or news.
Introduction to HTML
The full form of HTML
Hyper Text Markup Language.
HTML
It is a markup language which allows the user to create a web page. A HTML document
includes text, picture and links to other related information or document. It is not case sensitive.
To create a HTML document we need the following,
1. A Text Editor
2. A Web Browser
3. A Graphics Software
4. A Web Server
A text editor or a word processor allows us to create a HTML codes. The text editor should
support ASCII format of storing the data.
Example:- Notepad, WordPad
A web Browser us to test and execute the codes.
Example:- Internet Explorer, Netscape Navigator
To include pictures in the HTML document we can use Graphics software.
Example:- Adobe Photoshop
By using a web server, the document can be made available on the Internet.
What Is HTML5 ?
HTML5 is a specification defined to help web developers by extending HTML/XHTML with
new:
• Semantically rich elements
NANDINI S D, GFGCW, H N PURA Page 16
WEB TECHNOLOGIES (6TH SEM BSc)(NEP)
Additionally, there is the possibility of using HTML5 attributes to create web pages that are
Web Accessibility Initiative - Accessible Rich Internet Applications (WAI ARIA) enabled.
This refers to make web pages a whole lot more accessible to people with various disabilities.
HTML5 Example:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title of the document</title>
</head>
<body>
Content of the document......
</body>
</html>
HTML5 also introduces a number of APIs which helps making it easy to create web
applications, such as:
• 2D drawing API with the canvas element
• API for playing of video and audio (with the video and audio elements) • API that allows a
Web application to register itself for certain protocols or media types
• Editing API in combination with a new global content editable attribute . • Drag & drop API
in combination with a draggable attribute
• API that exposes Browser history and allows pages to add to it to prevent breaking the back
button
• Cross-document messaging with postMessage.
HTML5 seems to have two main areas of focus. Markup of webpage content, which is focused
on the look and feel of web sites and their pages. API ( Application Programming Interface ),
which is focused on building web driven commercial applications. In both these two areas
HTML5 delivers of a lot of brand new syntax, semantics and technology.
New Structural Elements HTML is largely unstructured. Hence in HTML5 a few new
elements have been introduced to try and rectify this weakness.
Features:
It has introduced new multimedia features that support 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 in 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 a web
browser.
Uses the 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″>
Element Explanation
<section> A section with web page content, or section of a chapter of a text
within a book
<header> The <header> element can be used to describe the web page header
section. This is not the same as the <head> element
<footer> The <footer> element can be used to describe the web page footer
section
<nav> The <nav> element can be used to encompass web page links. The
websites menu items can be bound within these elements
<article> The <article> element can be used to encapsule a blog article
<aside> The <aside> element can be used to provide extra information for a
block of text. Much like sidebar material in books.
<figure> The <figure> element can be used to annotate main text with
diagrams
An element
It is a fundamental component of the structure of a text document. It identifies how the
information should be presented to the user. An element includes a number of tags.
Example:- heads, tables, paragraphs, lists.
Tag
HTML tags allows us to mark the elements of a file for the browser. They consists of left angle
bracket (<) and a right angle bracket (>).There are two types of tag elements in HTML are
empty tag and a container tag.
An empty tag
It represents a formatting option like line break, paragraph setting. Ex: <p>, <br>, <li>
Container tag
It includes a section of text, that specifies a formatting construction for the selected text. It
always includes a start tag and end tag. <body> , <title>
Markup tags
1. HTML- It tells the browser that the file contains HTML coded information.
2. Head- It identifies the first part of the document that contains the title.
3. Title – It contains document title and identifies its content in a global context the title is
displayed in the title bar but not in the window.
4. Body- It contains the content of the document displayed within the text area of browser
window.
Tags Descriptions
Encloses the entire HTML5 document, serving as the root element for all HTML5
<html>
content.
Contains header information about the webpage, including title, meta tags, and
<head>
linked stylesheets. It is part of the document’s structure but is not displayed on the
Tags Descriptions
webpage.
Used within the <head> section to define the title of the HTML5 document. It
<title> appears in the browser tab or window and provides a brief description of the
webpage’s content.
Encloses the visible content of the webpage, such as text, images, audio, videos,
<body> and links. All elements within this tag are displayed on the actual webpage when
viewed in a browser.
Example
This example illustrates the Basic HTML structure.
<!DOCTYPE html>
<html>
<head>
<!-- Information about the web page -->
<!--This is the comment tag-->
<title>GeeksforGeeks</title>
</head>
<body>
<!--Contents of the webpage-->
<p>GeeksforGeeks is a online study platform</p>
</body>
</html>
HTML Headings
HTML Heading tag helps us to give headings to the content of a webpage. These tags are
mainly written inside the body tag. HTML provides six heading tags from <h1> to <h6>.
Every tag displays the heading in a different font size.
Syntax
<h1></h1>
<h2></h2>
<h3></h3>
<h4></h4>
<h5></h5>
<h6></h6>
Example
This example illustrates the use of 6 heading tags from <h1> to <h6> in HTML.
<!DOCTYPE html>
<html>
<head>
<title>HTML heading tag</title>
</head>
<body>
<h1>Heading 1 (h1)</h1>
<h2>Heading 2 (h2)</h2>
<h3>Heading 3 (h3)</h3>
<h4>Heading 4 (h4)</h4>
<h5>Heading 5 (h5)</h5>
<h6>Heading 6 (h6)</h6>
</body>
</html>
Output:
Syntax
// for Parapgraph
<p> Content... </p>
// for Break
<br>
Example
This example illustrates the use of <p> tag for writing a paragraph statement in HTML.
<!DOCTYPE html>
<html>
<head>
<title>
Example of paragraph and break elements
</title>
</head>
<body>
<p>
HTML stands for HyperText Markup Language.<br>
It is used to design web pages using a markup
language.<br>HTML is a combination of Hypertext
and Markup language.<br>Hypertext defines the
link between web pages.<br>A markup language
is used to define the text document within the
tag which defines the structure of web pages.
</p>
</body>
</html>
Output
Syntax
<hr>
Example
This example illustrates the use of the <hr> tag for the horizontal line in HTML.
<!DOCTYPE html>
<html>
<head>
<title>HTML <hr> tag</title>
</head>
<body>
<h1>Hello GeeksforGeeks</h1>
<p>
A Computer Science portal <br>
A Computer Science portal <br>
A Computer Science portal <br>
</p>
<hr>
<p>
A Computer Science portal <br>
A Computer Science portal <br>
A Computer Science portal <br>
</p>
<hr>
<p>
A Computer Science portal <br>
A Computer Science portal <br>
A Computer Science portal <br>
</p>
<hr>
</body>
</html>
Output
HTML Images
The <image> tag is used to insert an image into our web page. The source of the image to be
inserted is put inside the <img src=”source_of_image“> tag.
Syntax
<img src="geeks.png">
Example
This example illustrates the use of the <img> tag for inserting the images in HTML.
<!DOCTYPE html>
<html>
<head>
<title>HTML img tag</title>
</head>
<body>
<img src=
"https://media.geeksforgeeks.org/wp-content/cdn-uploads/Geek_logi_-low_res.png">
</body>
</html>
HTML Comments
HTML comments are ignored by browsers if we comment in HTML code then codes are more
readable to us. In lots of scenarios, we comment out a few elements for debugging purposes.
The single-line comment is given inside the ( <!– comment <!– comment
Single-line
–> ) tag. –>
<!– Multi
It follows the syntax of a single-line comment by adding
Multi-line Line
multiple lines in the comment.
Comment –>
HTML Text Formatting provides various tags for text formatting to enhance the visual
presentation of content on a webpage. You can make your text bold, italic, etc. by using some
HTML tags.
Text Formatting can be categorized into 2 techniques, i.e., the logical tag where the tags
denote the logical or semantic value of the text, and the Physical tag, which denotes the visual
appearance of the text.
Tags Descriptions
Example: This example display text in HTML strong, small, and Highlight formatting
respectively.
<!DOCTYPE html>
<html>
<head>
<title>
HTML text formatting
</title>
</head>
<body>
<h2>Welcome To GFGCW</h2>
<!--Text in Strong-->
<strong>Hello GFGCW </strong>
<br>
<!--Text in small-->
<small>Hello GFGCW </small>
<br>
<!--Text in Highlight-->
<mark>Hello GFGCW </mark>
</body>
</html>
Output:
<!--Text in Strong-->
<p>
<strong>Hello Gfgcw </strong>
</p>
</body>
</html>
Output:
Output:
Highlighting a Text
It is also possible to highlight a text in HTML using the <mark> tag. It has an opening tag
<mark> and a closing tag </mark>.
Example: The below example describes the use of the <mark> tag that is used to define the
marked text.
<!DOCTYPE html>
<html>
<head>
<title>Highlight the text in HTML</title>
</head>
<body>
<!--Text in Normal-->
<p>Hello Gfgcw </p>
<!--Text in Highlight-->
<p>
<mark>Hello Gfgcw </mark>
</p>
</body>
</html>
Output:
<!--Text in Normal-->
<p>Hello GFGCW</p>
<!--Text in Superscript-->
<p>Hello
<sup> GFGCW </sup>
</p>
<!--Text in Subscript-->
<p>Hello
<sub> GFGCW </sub>
</p>
</body>
</html>
Output:
</body>
</html>
Output:
Output:
Adding a Text
The <ins> element is used to underline a text marking the part as inserted or added. It also has
an opening and a closing tag.
Example: This example describes the use of the <ins> tag to used to specify a block of
inserted text.
<!DOCTYPE html>
<html>
<head>
<title>Inserting the text in HTML</title>
</head>
<body>
<!--Text in Normal-->
<p>Hello gfgcw</p>
<!--Text in Insert-->
<p>
<ins>Hello gfgcw </ins>
</p>
</body>
</html>
Output:
HTML5 Semantics:
HTML tags are classified into two types.
Semantic
Non-Semantic
Semantic Elements:
Semantic elements have meaningful names that tell about the type of content. For example
header, footer, table, … etc. HTML5 introduces many semantic elements as mentioned below
which make the code easier to write and understand for the developer as well as instruct the
browser on how to treat them.
<article>
NANDINI S D, GFGCW, H N PURA Page 34
WEB TECHNOLOGIES (6TH SEM BSc)(NEP)
<aside>
<details>
<figcaption>
<figure>
<footer>
<header>
<main>
<mark>
<nav>
<section>
<head> <body>
<title>Detail and summary Tag</title> <details>
<style> <summary class="GFGCW">
.GFG { GFGCW, H N Pura
Color:#006400; </summary>
font-size:50px; <p>Computer Science portal
Text-align:none; where you can learn good
margin-bottom:0px; programming.
} </p>
p{ </details>
font-size:25px; </body>
text-align:none;
margin-top:0px; </html>
}
Main:
It defines the main content of the document. The content inside the main tag should be
unique.
<!DOCTYPE html> White House etc
<html> </p>
<head> <article>
<title>main Tag</title> <h1>Rashtrapati Bhavan</h1>
<style> <p>
h1 { It is the home of
color:#006400; the President of India.
} </p>
p{ </article>
font-size:25px;
text-align:none; <article>
margin-top:0px; <h1>The White House</h1>
} <p>
</style> It is the home of the
</head> President of United
States of America.
<body> </p>
<main> </article>
<h1>Important Residences</h1> </main>
<p> </body>
A few of them are
Rashtrapati Bhavan, </html>
Mark:
It is used to highlight the text.
<!DOCTYPE html>
<html> <body>
<h1>mark tag</h1>
<head> <p>
<title>mark Tag</title> GFGCW is a
<style> <mark>Computer Science</mark>
h1 { portal
color:#006400; </p>
} </body>
</style>
</head> </html>
Table Layout
Tables are very useful to arrange in HTML and they are used very frequently by almost all web
developers. Tables are just like spreadsheets and they are made up of rows and columns. Tables
are defined with the <table> tag in HTML.A table is divided into rows with the <tr> tag where
tr stands for table row. A row is divided into data cells with the <td> tag, where td stands for
table data. A row can also be divided into headings with the <th> tag where th stands for table
heading. The <td> elements are the data containers in the table. The <td> elements can contain
all sorts of HTML elements like text, images, lists, other tables, etc.
Inside <table> element the table is written out row by row. A row is contained inside a
<tr> tag which stands for table row. And each cell is then written inside the row element using a
<td> tag which stands for table data.
Syntax:
Table Heading - The <th> Element:
Table heading can be defined using <th> element. This tag will be put to replace <td> tag which
is used to represent actual data.
Example
<html> <td> 20%</td>
<table border="5"> </tr>
<th> RollNo </th> <tr>
<th> Name </th> <td> BCM202301</td>
<th> Class </th> <td> Antony</td>
<th> Marks </th> <td> I BCOM</td>
<tr> <td> 50%</td>
<td> BCM202301</td> </tr>
<td> Amar</td> <tr>
<td> I BCOM</td> <td> BCM202309</td>
<td> 90%</td> <td> Sona</td>
</tr> <td> I BBA</td>
<tr> <td> 99%</td>
<td> BCM202301</td> </tr>
<td> Akbar</td> </table>
<td> I BCOM</td> </html>
Form
Web form is container of different controls which is displaying on web pages. By using <form>
tag we can create different form tools with its attributes.
Design a simple form
<html> <textarea rows="5" cols="50"
<body> name="description"> Enter description
<form action="Login" method="get"> here...
ENTER YOUR NAME: </textarea>
<input type="text" name="first_name" /> <p>
<br> Select Gender
SET PASSWORD: <br>
<input type="Password" name="last_name" <input type="radio" name="gender"
/> value="Male" /> Male <br>
<br> <input type="radio" name="gender"
Address: value="Female" /> Female<br>
<input type="radio" name="gender"
value="Female" /> SheMale<br>
NANDINI S D, GFGCW, H N PURA Page 40
WEB TECHNOLOGIES (6TH SEM BSc)(NEP)
Multimedia basics
The word multi and media are combined to form the word multimedia. The word “multi”
signifies “many.” Multimedia is a type of medium that allows information to be easily
transferred from one location to another. Multimedia is the presentation
of text, pictures, audio, and video with links and tools that allow the user to navigate,
engage, create, and communicate using a computer. Multimedia refers to the computer-
assisted integration of text, drawings, still and moving images(videos) graphics, audio,
NANDINI S D, GFGCW, H N PURA Page 41
WEB TECHNOLOGIES (6TH SEM BSc)(NEP)
animation, and any other media in which any type of information can be expressed, stored,
communicated, and processed digitally.
Images
Images are very important to beautify as well as to depict many concepts on your web page. It is
true that one single image is worth than thousands of words. So as a Web Developer you should
have clear understanding on how to use images in web pages. This is done in HTML using the
<img> element
Syntax:
<img src="image URL" attr_name="attr_value"...more attributes >
Attributes of <img> tag:
Following are the attributes for <img> tag.
• width: sets width of the image. This will have a value like 10 or 20%etc.
• height: sets height of the image. This will have a value like 10 or 20% etc.
• border: sets a border around the image. This will have a value like 1 or 2 etc.
• src: specifies URL of the image file.
Example:
<!DOCTYPE html>
<html>
<body>
<h1> III BCA STUDENTS 2022-23</h1>
<img src="D:\Photos\Studentspic.jpg"
alt="Team Members" width="700"
height="350">
</body>
</html>
Output:
Use of Frames
Frames divide a browser window into several pieces or panes, each pane containing a separate
HTML document. One of the key advantages that frames offer is that you can then load and
reload single panes without having to reload the entire contents of the browser window. A
collection of frames in the browser window is known as a frameset. The window is divided up
into frames in a similar pattern to the way tables are organized into rows and columns. The
simplest of framesets might just divide the screen into two rows, while a complex frameset
could use several rows and columns.
To create a frameset document, first you need the <frameset> element, which is used instead of
the <body> element. The frameset defines the rows and columns your page is divided into,
which in turn specify where each individual frame will go. Each frame is then represented by a
<frame> element.
The <frameset> Element:
• The <frameset> tag replaces the <body> element in frameset documents.
• The <frameset> tag defines how to divide the window into frames.
• Each frameset defines a set of rows or columns. If you define frames by using rows then
horizontal frames are created. If you define frames by using columns then vertical frames are
created.
• The values of the rows/columns indicate the amount of screen area each row/column will
occupy.
• Each frame is indicated by <frame> tag and it defines what HTML document to put into the
frame.
The <frameset> Element Attributes:
Following are important attributes of <frameset> and should be known to you to use frameset.
• cols: specifies how many columns are contained in the frameset and the size of each column.
You can specify the width of each column in one of four ways:
o Absolute values in pixels. For example to create three vertical frames, usecols="100,
500,100".
o A percentage of the browser window. For example to create three vertical frames, use
cols="10%, 80%,10%".
o Using a wildcard symbol. For example to create three vertical frames, usecols="10%, *,10%".
In this case wildcard takes remainder of the window.
o As relative widths of the browser window. For example to create three vertical frames, use
cols="3*,2*,1*". This is an alternative to percentages. You can use relative widths of the
browser window. Here the window is divided into sixths: the first column takes up half of the
window, the second takes one third, and the third takes one sixth.
• rows: attribute works just like the cols attribute and can take the same values, but it is used to
specify the rows in the frameset. For example to create two horizontal frames, use rows="10%,
90%". You can specify the height of each row in the same way as explained above for columns.
• border: attribute specifies the width of the border of each frame in pixels. For example
border="5". A value of zero specifies that no border should be there.
• frameborder: specifies whether a three-dimensional border should be displayed between
frames. This attrubute takes value either 1 (yes) or 0 (no). For example frameborder="0"
specifies no border.
• framespacing: specifies the amount of space between frames in a frameset. This can take any
integer value. For example framespacing="10" means there should be 10 pixels spacing
between each frames.
The <frame> Element:
The <frame> element indicates what goes in each frame of the frameset. The <frame>
element is always an empty element, and therefore should not have any content, although each
<frame> element should always carry one attribute, src, to indicate the page that should
represent that frame.
The <frame> Element Attributes:
Following are important attributes of and should be known to you to use frames.
• src: indicates the file that should be used in the frame. Its value can be any URL. For example,
src="/html/top_frame.htm" will load an HTML file avaible in html directory.
• name: attribute allows you to give a name to a frame. It is used to indicate which frame a
document should be loaded into. This is especially important when you want to create links in
one frame that load pages into a second frame, in which case the second frame needs a name to
identify itself as the target of the link.
• frameborder: attribute specifies whether or not the borders of that frame are shown; it
overrides the value given in the frameborder attribute on the <frameset> element if one is given,
and the possible values are the same. This can take values either 1 (yes) or 0 (no).
Example:
<html>
<head>
<title>Sidebar.html</title></head>
<frameset cols="25%,50%,25%">
<frameset rows="50%,50%">
<frame src="time.html">
<frame src="address.html">
</frameset>
<frame src="college.html">
<frame src="Link.html">
</frameset>
</html>
Map tag
The <map> tag is to define the map-image on the user interface which is clickable.
The <map> required the <img> tag that helps the relation between the image and map.
The <map> element contains a number of <area> elements that define the clickable areas in
the image map.
Syntax:
<map name=""> </map>
Audio clips
To embed audio in HTML, we use the <audio> tag. Before HTML5, audio cannot be added to
web pages in the Internet Explorer era. To play audio, we used web plugins like Flash. After
the release of HTML5, it is possible. This tag supports Chrome, Firefox, Safari, Opera, and
Edge in three audio formats – MP3, WAV, OGG. Only Safari browser doesn’t support OGG
audio format.
Syntax:
<audio>
<source src="file_name" type="audio_file_type">
</audio>
Attributes of <audio> tag
Attribute Value Description
autoplay autoplay When the page is loaded. It specifies to play audio as soon as possible.
muted muted When the page is loaded audio will be automatically muted.
auto
It specifies how the author thinks the audio will be loaded when the
preload metadata
page is ready.
none
Example:
<!DOCTYPE html> <head>
<html> <title>Page Title</title>
NANDINI S D, GFGCW, H N PURA Page 45
WEB TECHNOLOGIES (6TH SEM BSc)(NEP)
</head> Output:
<body>
<h2>Click play button to play audio</h2>
<audio src="./test.mp3" controls></audio>
</body>
</html>
Video clips
To embed video in HTML, we use the <video> tag. It contains one or more video sources at a
time using <source> tag. It supports MP4, WebM, and Ogg in all modern browsers. Only Ogg
video format doesn’t support in Safari browser.
Syntax
<video>
<source src="file_name" type="video_file_type">
</video>
Attributes of <video> tag
Attribute Value Description
autoplay autoplay When the page is loaded. It specifies to play video as soon as possible.
controls controls It displays video control such as play, pause, and stop.
muted muted When the page is loaded video will be automatically muted.
auto
It specifies how the author thinks the video will be loaded when the
preload metadata
page is ready.
none
It specifies the width of the video area. The default value of width is
width pixels
‘auto’.
It specifies the height of the video area. The default value of height is
height pixels
‘auto’.
Example:
In this example, we will add a video to our webpage. To add video, we will use the <video>
tag defining source using <source> tag. Create an HTML file just like an audio file example
and save the video file in the same directory. Suppose a video file name test.mp4 save in the
same directory where your HTML file was saved.
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h2>Click play button to play video</h2>
<video src="./test.mp4" controls></video>
</body>
</html>
Output: