HTML PPT-Unit I MSD
HTML PPT-Unit I MSD
HTML PPT-Unit I MSD
Development
We rely on different websites for
different purposes like:
Submitting online applications
Viewing web content
Watching movies
Online shopping
Online Banking
World Wide Web:
WWW is a collection of web documents
and resources, which can be accessible
over internet.
Internet:
An internet is a network of devices,
connected to each other in order to
share information.
A Website is a collection of web
pages.
A Web page may contain text,
graphics, sounds, animations and
movies.
Web pages are designed using
HTML (Hyper Text Markup
Language).
How is this website made
available on the Internet?
are used to
connect
external
devices to
the
Software Ports
These are used to connect a client
computer to a server to access its
services like HTTP, FTP, SMTP etc.
The software ports are given unique
numbers.
These are used to identify the different
services like e-mail, file transfer etc.
Software Ports
Port number is a 16-bit number
which when added to a
computers IP address/ URL, can
be used for communicating with
the particular service available on
that server.
DNS Servers
It runs a special purpose
networking software that
contains a database of domain
names and IP Addresses.
Uniform Resource Locator
URL uniquely identifies the
particular resource in the
internet. It has the following
components:
Protocol://host:port/path
HTML
Hyper Text Markup Language is
used to design web pages.
It defines the meaning and
structure of web content.
It consists of tags and attributes
used to format web pages.
Static Web Pages
Developed by Tim
at CERN, a European
Particle Physics
Laboratory.
HTML
The HTML files must be saved
with .htm or .html extension.
HTML pages are viewed with the
help of web browsers.
Popular web browsers are:
Microsoft Internet Explorer/Edge
Google Chrome
Mozilla Firefox
Opera..
Tags
Tags are generally classified into
two types:
Container tag
Empty tag
Container tag or element
This type of HTML tag or elements
require pair of tags i.e. a starting
tag as well as an ending tag.
<html>…..</html>
<head>…..</head>
<title>…...</title>
<body>…..</body>
Empty tag/ Element
This type of tag just requires a
starting tag not an ending tag.
<br>
<frame>
<img>
<hr> etc..
Attributes
An attribute is a special word used to
provide an additional information to the tag
such as color, alignment, background etc..
bgcolor
background
alignment
src
type etc..
Basic Structure of HTML
Formatting Tags
Used for formatting the text
contents in the body section of the
HTML document.
1. Heading Tags: (H1 to H6)
Main attribute for this tag is align.
Possible values are: left, right,
center.
Ex: <h1
INTRODUCTION TO LISTS
Lists are the best way to provide
information in a structured, easy-
to-read format.
Lists are the best method of
organizing information and
presenting it in a structured
fashion.
TYPES OF LISTS
Definition Lists
Ordered List (Numbered List)
-Mango
-Orange
VEGETABLE
- Brinjal
-Cabbage
-Tomato
Definition Lists
• A definition list is a list of items, with
a description of each item.
• The <dl> tag defines a definition list.
• The <dl> tag is used in conjunction
with <dt> (defines the item in the
list) and <dd> (describes the item in
the list).
• E.g.
• <dl>
<dt>Coffee</dt>
<dd>- black hot drink</dd>
<dt>Milk</dt>
<dd>- white cold drink</dd>
</dl>
INTRODUCTION HTML Hyperlinks
• A hyperlink (or link) is a word, group of words, or
image that you can click on, to jump to a new
document or a new section within the current
document.
• When you move the cursor over a link in a Web
page, the arrow will turn into a little hand.
• HTML provides <A> Anchor Tag to create links.
The format of using anchor tag is as follows:
• Example:
<A HREF ="http://www.nios.ac.in">Link to
Website of NIOS </A>
OR
<A
HREF="http://www.nios.ac.in/offices.htm">Link
s to Contact Us page of NIOS </A>
Linking (jumping) to a specific place
within the same document.
Sometimes, it is required to jump different
sections in the same document. For this it
needs two steps, first; identify section
with a name and or second; use jumps to
the location using the name used.
The syntax is:
<table>…</table> container to
format.
◦ background
◦ bgcolor
◦ border
◦ cellspacing
◦ cellpadding
◦ width
◦ height
The <tr>…</tr>
Container
Defines a table row
Structural tag only (no content)
Attributes
1. align
2. valign
3. bgcolor
The <td>…</td> Container
Defines a data cell in a table
Can contain any content, including
another, nested table
Attributes:
align background width
<tr>
<td colspan=“2”
bgcolor=“blue”>
</td>
<td>
…
</td>
</tr>
<td rowspan …> Example
<tr>
<td rowspan=“2”
bgcolor=“blue”>
</td>
<td>
…
</td>
</tr>
<th>…</th> Container
Defines a header cell
Acts just like a <td>…</td>
container, except …
The text is normally centered
vertically and horizontally AND the
text is bold
Attributes are the same as <td>…
<th>…</th> Example
<tr>
<th>
Table
</th>
<th>
…
</th>
</tr>
<caption>…</caption>
Container
Provides a summary of the table’s
purpose
MUST immediately follow <table>
Attributes:
◦align
◦summary
◦valign
<caption>…</caption> Example
<caption align=“center”
summary=“Long Description goes
here”
valign="bottom">
Figure 1: Hexadecimal Conversions
</caption>
<html> <tr>
<table border="3"> <td>Node</td>
<caption> <td>React</td>
Web Technologies </tr>
</caption>
<tr>
<thead>
<td>Express</td>
<th>Back-end JS
</th> <td>Angular</td>
<th>Front-end JS </tr>
</th> </tbody>
</thead> </table>
<tbody>
</html>
OUTPUT:
Editing elements – Need
While developing any content-
based application, there may be
a requirement to get it reviewed.
While reviewing the content of
our web page, the reviewer may
want to add or delete some
content.
For this scenario, editing
elements can be used.
List of Editing Elements
The following are elements used
for editing.
del: It defines deleted text by
striking on it
ins: It defines inserted text by
underlining it
Example:
Embedded Elements
Embedding content like audio
clips, videos, images, maps, and
so on... are a great way of
engaging, be entertaining and be
able to quickly deliver information
to the website users.
Image Element
Embedding images to a web page can be
done with the <img>...</img> tag.
The <img> tag has attributes 'src' and
'alt' where src defines the location of the
image and alt defines the alternative text
if it is failed to load the image inside the
web page.
Image Captions
element <figure> along with <figcaption>
element which help us to provide caption
for our images.
<figure>
<img src="tropicalSea.jpg" alt="An
image of tropical sea" width="400"
height="341">
<figcaption>A colorful tropical sea
view</figcaption>
</figure>
The <figure> element in HTML is
content.
Embedding Video:
Here is the simplest form of
embedding a video file in your
webpage −
<video src = "foo.mp4" width =
"300" height = "200" controls>
Your browser does not support the
<video> element.
HTML5 - Audio & Video
data.
pattern="[A-Za-z]"/>
Min, Max, and Step
which are used only with range and
number input types
min: Specifies a minimum acceptable
value.
max: Specifies maximum acceptable
value.
step: Specifies a difference of
consecutive values when the user uses
the range/number input element.
Job experience: <input type="number"
min="2" max="10" step="1"/>
Required
The required attribute specifies that
user input is a must.
If the user does not enter any value, a
default error message appears on the
screen.
Username: <input type="text"
required/>
Username: <input type="password"
required/>
Multiple
The multiple attribute value
allows the user to
enter/select/upload more than one
value.
<input type="file" multiple/>
Form-Override
The override attributes can be
used to override the form-level
built-in attribute functionalities
using the submit/image input
elements.
Form-override
Description
attribute
Overrides the form action
Formaction
attribute
Overrides the form novalidate
formnovalidate
attribute
Overrides the form method
Formmethod
attribute
In the below example, you can
observe that the default form
submission method 'GET' has
been overridden to the
'POST' method due to the usage
of 'formmethod' attribute in the
submit input tag.
<form method="GET" action="">
<input type="submit"
formmethod="POST">
</form>
Need of novalidate attribute
To test the form's functionality we
may want to temporarily by-pass in-
built validations done by form input
type elements. This can be done by
novalidate attribute.
For example, if we want to bypass an
email validation, you can use the
below code:
<form novalidate action='xyz.html'>
<input type="email"/>
<input type ="submit">
</form>
iframe element
The HTML <iframe> tag specifies an inline frame.
An inline frame is used to embed another
document within the current HTML document.
Syntax:
<iframe src="url" title="description"></ifra
me>
Tip: It is a good practice to always include
a title attribute for the <iframe>. This is used by
screen readers to read out what the content of
the iframe is.
Iframe - Set Height and Width
Use the height and width attributes to specify the
size of the iframe. The height and width are
specified in pixels by default.
Example
<!DOCTYPE html>
<html>
<body>
<h2>HTML Iframes</h2>
<p>You can use the height and width
attributes to specify the size of the
iframe:</p>
<iframe src="demo_iframe.htm"
height="200" width="300"
title="IframeExample"></iframe>
</body>
</html>
Or you can add the style attribute and use the
CSS height and width properties:
Example
<iframe src="demo_iframe.htm" style="height
:200px;width:300px;" title="Iframe Example">
</iframe>
Iframe - Remove the Border
By default, an iframe has a border around
it. To remove the border, add
the style attribute and use the
CSS border property:
Example
<iframe src="demo_iframe.htm"
style="border:none;" title="Iframe
Example">
</iframe>
With CSS, you can also change the size,
style and color of the iframe's border:
Example
<iframe src="demo_iframe.htm"
style="border:2px solid
red;" title="Iframe
Example"></iframe>
Iframe - Target for a Link
An iframe can be used as the target
frame for a link. The target attribute
of the link must refer to
the name attribute of the iframe:
Example
<iframe src="demo_iframe.htm" na
me="iframe_a" title="Iframe
Example"></iframe>
<p><a href="https://www.w3schools
.com" target="iframe_a">W3Schools
.com</a></p>
Frame element:
To
divide the web browser window into
multiple sections where each section
can be loaded separately.
A frameset tag is the collection of
frames in the browser window.
Creating Frames: Instead of using
body tag, use frameset tag in HTML to
use frames in web browser.
Not Supported in HTML5.
The
<frameset> tag was used in
HTML 4 to define a frameset.
<html>
<frameset rows="*,*">
<frame src="iframe.html">
<frame src="iframe1.html">
</frameset>
</html>
<html>
<frameset rows="*,*">
<frame src="iframe.html">
<frameset cols="20%,*,10%">
<frame src="unlist.html">
<frame src="tbl.html">
<frame src="links.html">
</frameset>
<frame src="iframe1.html">
</frameset>
</html>
HTML5 - SVG
SVG stands for Scalable Vector
Graphics
Defines the graphics in XML format.
Every element and every attribute in
SVG files can be animated
SVG is a W3C recommendation
SVG integrates with other W3C
standards such as the DOM and XSL
HTML5 - SVG