SlideShare uma empresa Scribd logo
1 de 66
Internet & Web Designing
BCA -302
Unit-2 : Introduction to HTML
2
Learning
Objectives
Introduction to design a static web-page using HTMl
Tag
How to design web page according to a structure
Overview of HTML Tags , attributes, etc.
3
Unit-2 : Introduction to HTML
• Basic concept
• HTML tags
• Commonly used HTML Commands
• Title & Footers
• Text Formatting
• Text Styles
• Lists
• Adding Graphics to HTML Documents
• Linking Documents
• Tables
• Frames
Introduction to HTML
 HTML is an acronym which 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.
 Markup language: A markup language is a computer language that is used to apply
layout and formatting conventions to a text document. Markup language makes text more
interactive and dynamic. It can turn text into images, tables, links, etc.
 Web Page: A web page is a document which is commonly written in HTML and translated
by a web browser. A web page can be identified by entering an URL. A Web page can be
of the static or dynamic type. With the help of HTML only, we can create static web
pages.
Hence, HTML is a markup language which is used for creating attractive web pages with the
help of styling, and which looks in a nice format on a web browser.
4
Introduction to HTML
 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.
 Originally, HTML was developed with the intent of defining the structure of
documents like headings, paragraphs, lists, and so forth to facilitate the sharing
of scientific information between researchers. Now, HTML is being widely used
to format web pages with the help of different tags available in HTML language
 Extension of HTML file is .htm or .html
5
HTML Version
Since the time HTML was invented there are lots of HTML versions in market, the brief introduction about the
HTML version is given below:
● HTML 1.0: The first version of HTML was 1.0, which was the barebones version of HTML language, and
it was released in1991.
● 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 style sheets
(CSS) and scripting ability for various multimedia elements.
● HTML5 : HTML5 is the newest version of Hyper Text 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.
6
Features of HTML
1. It is a very easy and simple language. It can be easily understood and
modified.
2. It is very easy to make an effective presentation with HTML because it has a
lot of formatting tags.
3. It is a markup language, so it provides a flexible way to design web pages
along with the text.
4. It facilitates programmers to add a link on the web pages (by html anchor tag),
so it enhances the interest of browsing of the user.
5. It is platform-independent because it can be displayed on any platform like
Windows, Linux, and Macintosh, etc.
6. It facilitates the programmer to add Graphics, Videos, and Sound to the web
pages which makes it more attractive and interactive.
7. HTML is a case-insensitive language, which means we can use tags either in
lower-case or upper-case
7
Advantages of HTML
● Create Web site - You can create a website or customize an existing web
template if you know HTML well.
● Become a web designer - If you want to start a carrer as a professional web
designer, HTML and CSS designing is a must skill.
● Understand web - If you want to optimize your website, to boost its speed and
performance, it is good to know HTML to yield best results.
● Learn other languages - Once you understands the basic of HTML then other
related technologies like javascript, php, or angular are become easier to
understand.
8
Application of HTML
● Web pages development - HTML is used to create pages which are rendered
over the web. Almost every page of web is having html tags in it to render its
details in browser.
● Internet Navigation - HTML provides tags which are used to navigate from
one page to another and is heavily used in internet navigation.
● Responsive UI - HTML pages now-a-days works well on all platform, mobile,
tabs, desktop or laptops owing to responsive design strategy.
● Offline support HTML pages once loaded can be made available offline on
the machine without any need of internet.
● Game development- HTML5 has native support for rich experience and is
now useful in gaming developent arena as well.
9
HTML Editors
● 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 can be directly
downloaded, but for a beginner, the best text editor is Notepad (Windows) or
TextEdit (Mac).
● After learning the basics, one can easily use other professional text editors
which are, Notepad++, Sublime Text, Vim, etc.
10
Building Blocks of HTML
An HTML document consist of its basic building blocks which are:
● Tags: An HTML tag surrounds the content and apply meaning to it. It is written between < and >
brackets.
● Attribute: An attribute in HTML provides extra information about the element, and it is applied
within the start tag. An aHTML attribute contains two fields: name & value.
● Elements: An HTML element is an individual component of an HTML file. In an HTML file,
everything written within tags are termed as HTML elements. An HTML element is defined by a
start tag, some content, and an end tag:
<tagname>Content goes here...</tagname>
11
overview of the structure of HTML elements
Structure of HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> Document Title Goes Here </title>
...Head information describing the document ....
</head>
<body>
...Document content and markup go here....
</body>
</html>
12
overview of the structure of HTML elements
HTML Documents
All HTML documents must start with a document 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>.
The <!DOCTYPE> Declaration:The <!DOCTYPE> declaration represents the document type, and
helps browsers to display web pages correctly. It must only appear once, at the top of the page
(before any HTML tags).
<html>:This tag encloses the complete HTML document and mainly comprises of document header
which is represented by <head>...</head> and document body which is represented by
<body>...</body> tags
<head> This tag represents the document's header which can keep other HTML tags like <title>,
<link> etc.
<title> The <title> tag is used inside the <head> tag to mention the document title.
<body> This tag represents the document's body which keeps other HTML tags like <h1>, <div>,
<p> etc
13
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.
 HTML tags contain three main parts: opening tag, content and closing tag. But some HTML tags
are unclosed tags.
 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.
 An HTML file must have some essential tags so that web browser can differentiate between a
simple text and HTML text.
 One can use as many tags as per the code requirement.
 All HTML tags must enclosed within < > these brackets.
 Every tag in HTML perform different tasks.
14
Types of HTML Tags
 Paired tags : Paired tags have an opening and closing tag. The opening tag is similar to the
single tag and the closing has first slash. (<html></html>, <p></p>,etc.)
 Singular Tags / Un-paired tags: A tag is set to be a singular tag when there is no closing tag for
that or Tag is said to be singular tag when there is no companion tag. For example, we have
only one tag which doesn’t require any closing tag and it must always be a single tag, that is
why it’s called singular tag Singular Tags are also called: Unpaired Tags, Standalone tag, Tag
without companion tag. (<br/>, <hr/>, etc.)
 Meta Tags: Meta Tags are those tags which are used in the <head> section of the website,
which provides relative data about the web-page to the search engine.
 Self-Closing Tags: Self-Closing Tags are those HTML tags that do not have a partner tag, where
the first tag is the only necessary tag that is valid for the formatting. The main and important
information is contained WITHIN the element as its attribute. An image tag is the classic
example of a self-closing tag.
 Utility Based Tag: The HTML tags can be widely differentiated on the basis of their utility, that is,
on the basis of the purpose they serve. We can divide them basically into three categories as
formatting tag, structure tags, control tags
15
Commonly used HTML Tags
 <HTML> </HTML>
 <HEAD></HEAD>
 <TITLE></TITLE>
 <BODY></BODY>
 HEADING TAG : Used for marking sections and subsections in a document. ( <H1></H1>,
<H2></H2>, <H3></H3>, <H4></H4>, <H5></H5>, <H6></H6> )
16
<HTML ></HTML> Tag
 The <html> tag delimits the beginning and the end of an HTML document.
 Given that <html> is the common ancestor of an HTML document it is often called the root
element, as it is the root of an inverted tree structure containing the tags and content of a
document.
 The <html> tag, however, directly contains only the <head> tag, the <body> tag, and potentially
the <frameset> tag instead of the <body> tag.
 The <html> tag's typical use in a document is as a container for all other elements.
17
 The information in the head of an HTML document is very important because it is used to
describe or augment the content of the document.
 In many cases, the information contained within the <head>tag is information about the
information of the page, which generally is referred to as meta-information.
 This is a very important and often overlooked aspect of HTML documents. Search engines
use meta-information to index Web pages.
 Aside from meta-information, the head element can include author contact information,
scripts, style sheets, comments—and, most importantly, a page title.
<HEAD></HEAD> Tag
<TITLE></TITLE> Tag
 The most important head element is the title element, which most browsers display in a title bar
at the top of the browser window.
 The document title is actually the only tag required under traditional HTML specifications and
should occur as the first element within the head element.
 Regardless of specification variations, the <title> tag must be used in every HTML document as
it gives an HTML document a title by which it is known to browsers and indexing robots.
 Browsers display the document title while the document is being viewed, and might also use the
title in bookmark lists.
 Search engines that index the Web often place special meaning on the contents of the title
element when determining what a page is about. Because of this, a title should indicate the
contents of a page without ambiguity.
 While titles should be descriptive, they should also be concise. Authors should limit title length
to a reasonable number of characters.
18
Other Head Elements
In addition to the title element within the head element include base, isindex, link, meta, object,
script, and style.
 The <base> tag specifies an absolute URL address that is used to provide server and directory
information for partially specified URL addresses called relative links used within the document.
 The <isindex> tag indicates that the document contains a searchable index. It causes the
browser to display a query prompt and a field for entering a query.
 The <link> tag specifies a special relationship between the current document and another
document. It can be used in hypertext navigational relationships including prefetching of
documents by browsers.
 The <meta> tag uses name/value pairs to provide meta-information about a document. The
<meta> element often provides descriptive information targeted by Web search engines. In a
very different use, the <meta> tag can define various HTTP request values such as a page
refresh or an expiration time.
19
Other Head Elements contd…
 The <object> tag allows programs and other binary objects to be directly embedded in a Web
page. The most popular current approaches use Java applets, plug-ins, or ActiveX controls to
embed multimedia elements such as Flash animations, sounds, or movies.
 The <script> tag allows programs written in a scripting language to be directly embedded in a
Web page. The most popular scripting language in Web documents is JavaScript, which is
somewhat standardized in the form of ECMAScript, although few Web practitioners refer to it as
that. The script element and associated usage of scripts, often dubbed Dynamic HTML (DHTML)
because it allows HTML elements to be modified dynamically, should simply be considered a
form of client-side scripting.
 The <style> tag encloses document-wide style specifications relating to fonts, colors,
positioning, and other aspects of content presentation. Today, the primary style sheet
technology used in Web pages is called Cascading Style Sheets (CSS).
20
<BODY></BODY> Tag
 After the head section, the body of a document is delimited by <body> and </body>.
 Only one body element can appear per document. Because the body element delimits the
document itself, its attributes are primarily used to effect change across the entire document,
such as setting background images, background colors, and link and text color.
 When you create a Web page, you can change several things in the body of your document by
adding attributes to the <body> tag.
<body bgcolor="black" text="red" link="yellow" alink="orange" vlink="white“ background="image.gif">
 We can use as many or as few of these attributes as we wish. The options we don't use will be
set to the Web browser's default values.
21
Attributes of <BODY> tag
22
Text & Paragraph Formatting Tag
23
<p></p>
 Surrounding text with the <p> and </p>
tags indicates that the text is a logical
paragraph unit.
 On encountering this tag the browser,
moves onto the new line, skipping one
or two line between the previous line
and the new line depends on the
browser and any applied style sheet.
 The align attribute of <p> makes it
possible to specify a left, right, center or
justify alignment.
 Web browser ignore multiple
consecutive <p> tags.
<p align=”value”>………</p>
<br>
 This tag inserts a single carriage return or line
break into a document.
 It is an empty element—thus, it has no close
tag.
 Browser recognize multiple consecutive <br>
tags.
 The one attribute commonly used with a <br>
tag is clear. This attribute controls how text
flows around images or embedded objects
Text & Paragraph Formatting Tag Contd..
24
<hr>
<hr align="left" width="100" size=”10” noshade=”noshade”>
As sections are added to an HTML document, it is often useful to break up the
document into visually/logically distinct sections. A horizontal rule, indicated by the
<hr> tag, is an empty block- level element that serves this purpose.
Different attributes of <hr> :
1. The size attribute sets the bar's thickness (height) in pixels.
2. The width attribute sets the width of the rule. It can be set to a fixed number of
pixels, or to a percentage of the available screen width.
3. The align attribute sets its alignment to left, right, or center (default).
4. The noshade attribute renders the bar without a surrounding shadow.
5. The color attributes specifies the color of the rule.
Text & Paragraph Formatting Tag Contd..
25
Bold Text (<b>…</b> )
Displays text in BOLDFACE Style. The tags used are <B>..</B>
Italic Text (<i>…</i>)
Displays text in Italic. The tags used are <I>…</I>
Underline (<u>…</u>)
Displays text as underlined, the tags used are <U>…</U>
<big>…<big>
Enclosing content within a <big> tag pair makes it one size bigger.
<small> … </small>
Displays text with one smaller size.
<sup>…</sup>
The <sup> tag defines superscript text. Superscript text appears half a character above
the baseline. Superscript text can be used for footnotes, like 𝑎2
+ 𝑏2
= 𝑐2
.
<sub>…</sub>
The <sub> tag defines subscript text. Subscript text appears half a character below the
baseline. Subscript text can be used for chemical formulas, like H2O.
Text & Paragraph Formatting Tag Contd..
26
<abbr>…</abbr>
<abbr title="United Nations">UN</abbr>
<acronym>…</acronym>
<acronym title="World Wide Web">WWW</acronym>
The <center> Tag (<center>…</center>)
<center>… </center> tags are used to center everything found between them- text,
lists, images, rules, tables or any other page element.
<center>I am centered!</center>
Fonts
The basic syntax of <font>
<font color="color value" size="size value from 1-7" face="list of font faces">
styled text here
</font>
Given this syntax using <font>, you can set the color attribute equal to a valid color
name such as "red" or an equivalent hex value such as #FF0000 to color text.
e.g. <p><font color="red">This is red.</font> This is not.</p>
Text & Paragraph Formatting Tag Contd..
27
<address>… </address>
 The <address> tag defines the contact information for the author/owner of
a document or an article.
 If the <address> element is inside the <body> element, it represents
contact information for the document.
 If the <address> element is inside an <article> element, it represents
contact information for that article.
 The text in the <address> element usually renders in italic.
<CITE> Citations </CITE> Citations
<CODE> Source Code </CODE> Source Code
Text AnimationTag
28
<blink>
Its simple goal is to make text blink:
<blink> Buy now! </blink>
<marquee>
To create messages that scroll and slide across a viewer's screen in a variety
of different ways.
Using the element is simple; just enclose some text in it and it is transformed
into a scrolling ticker tape, similar to the one found at Times Square.
<marquee>
Welcome to MKICS.
</marquee>
Text Animation Tag contd…
29
<marquee bgcolor="yellow“ behavior="alternate“ direction="right“ loop="6”
scrollamount="1” scrolldelay="40“ title="Silly tags aren't just for Netscape
anymore.“ width="80%">Welcome to MKICS</marquee>
Changing the attributes will adjust the presentation of the marquee.
 The behavior attribute may be set to alternate, scroll, or slide.
 The direction attribute is used to set the direction in which the scrolled text moves. The
allowed values for this attribute are down, left, right, and up.
 The loop attribute is used to set the number of times that the message loops in the
scroll region. By default, unless the behavior is set to slide, a marquee scrolls forever.
The value of the loop attribute should be a positive integer.
 Setting scrollamount to a particular number of pixels allows the smoothness of the
scroll to be controlled. The value of the scrollamount attribute is set to the number of
pixels between each drawing of the scrolled message in the display area. The larger
the value in pixels, the less smooth the scroll.
 The scrolldelay attribute is used to set the number of milliseconds between each
rendering of the scrolled message. A higher value for this attribute slows the scrolling.
A reasonable value for this attribute is 50 or greater. Lower values for scrolldelay tend
tom produce marquees that are very difficult to read.
Comment in HTML
30
The contents of HTML comments are not displayed within a browser window.
Comments are denoted by a start value of <!-- and an end value of -->.
Comments can be many lines long. For example,
<!– This is a Comment.
Comment will not be displayed
-->
List in HTML
31
There are three basic forms of list
1. Ordered List <ol> (Numbering)
2. Un-ordered List <ul> (Bullets)
3. Definition List <dl>
Ordered List in HTML
32
 An ordered list, as enclosed by <ol> and </ol>, defines a
list in which order matters.
 Ordering typically is rendered by a numbering scheme,
using Arabic numbers, letters, or Roman numerals.
 Ordered lists are suitable for creating simple outlines or
step-by-step instructions because the list items are
automatically numbered by the browser.
<ol>
<li> Item 1 </li>
<li> Item 2 </li>
<li> Item 3 </li>
</ol>
Attributes of Ordered List in HTML
33
type
The type attribute of <ol> can be set to :
a for lowercase letters
A for uppercase letters
i for lowercase Roman numerals
I for uppercase Roman numerals
1 for regular numerals ( 1 is the default value)
Each <li> tag can have a local type attribute set to a, A, i, I, or 1.
start
 The <ol> element also has a start attribute that takes a numeric value
to begin the list numbering.
 Whether the type attribute is a letter or a numeral, the start value
must be a number. To start ordering from the letter j, you would use
<ol type="a" start="10"> because j is the tenth letter.
 Lists can be nested.
For e.g.
<ol>
<li> Item 1 </li>
<ol type=“a”> >
<li> Item1 a </li>
<li> Item1 b </li>
</ol>
<li Item 2 </li>
<li> item3 </li>
</ol>
Types of Ordered List in HTML
34
TYPE Numbering Styles
1 Arabic numbers 1,2,3, ……
a Lower alpha a, b, c, ……
A Upper alpha A, B, C, ……
i Lower roman i, ii, iii, ……
I Upper roman I, II, III, ……
Un-Ordered List in HTML
35
 An unordered list, signified by <ul> and </ul>, is used for lists of items in which the
ordering is not specific.
 A browser typically adds a bullet of some sort (a filled circle, a square, or an empty
circle) for each item and indents the list.
 Like ordered lists, unordered lists can be nested.
type Atrribute
 The type attribute can be used to set the bullet type for a list.
 The allowed values for type are: disc , circle, square.
 Like ordered lists, unordered lists can be nested. However, in this case each level of
nesting indents the list farther, and the bullet changes accordingly. Generally, a filled
circle or solid round bullet is used on the first level of lists. An empty circle is used for
the second-level list.
Third-level nested lists generally use a square. For e.g.
<ul>
<li> Item 1 </li>
<li Item 2 </li>
<li> item3 </li>
</ol>
Definition List in HTML
36
A definition list is a list of terms paired with associated definitions—in other words,
a glossary.
Definition lists are enclosed within <dl> and </dl>.
Each term being defined is indicated by a <dt> element, which is derived from
"definition term.“
Each definition itself is defined by <dd>.
For e.g.
<dl>
<dt> item1 </dt>
<dd> Description of item1 </dd>
<dt> item2 </dt>
<dd> Description of item2 </dd>
</dl>
What will be the output ?
37
<H1 ALIGN="CENTER">SAFETY TIPS FOR CANOEISTS</H1>
<OL TYPE=“a” START=“2”>
<LI>Be able to swim </LI>
<LI>Wear a life jacket at all times </LI>
<LI>Don't stand up or move around. If canoe tips,
<UL>
<LI>Hang on to the canoe </LI>
<LI>Use the canoe for support and </LI>
<LI>Swim to shore
</UL> </LI>
<LI>Don't overexert yourself </LI>
<LI>Use a bow light at night </LI>
</OL>
Output :
38
Adding Links to HTML- Anchor Tag<a></a>
39
 In HTML, the main way to define hyperlinks is with the anchor tag, <a>.
 A link is simply a unidirectional pointer from the source document that contains the link
to some destination.
 In hypertext, the end points of a link typically are called anchors, thus the use of the
anchor nomenclature in HTML documentation.
 For linking purposes, the <a> tag requires one attribute:
 href. The href attribute is set to the URL of the target resource, which basically is the
address of the document to link to, such as http://www.yahoomail.com.
 The text enclosed by an a element specifies a "hot spot" to activate the hyperlink.
 Anchor content can include text, images, or a mixture of the two.
 A general link takes the form <a href="URL">Visit our site</a>.
 The text "Visit our site" is the link. The URL specified in the href attribute is the
 destination if the link is activated.
 The following is an example of simple link usage:
<a href="http://www.yahoo.com">
Yahoo!
</a>
Anchor Tag<a></a> contd…
40
 In most browsers, text links are indicated by underlined text. Text is blue if the
destination has never been visited, purple if it has been visited, and briefly red as the
link is activated.
 If a link includes an image, the border of the image also will be blue or purple, unless
the border attribute has been set to zero.
 HTML authors can override these default link colors with changes to the link, alink,
and vlink attributes of the body element.
Anchor Tag Attributes…
41
Name
 An <a> tag usually defines a hyperlink's source location: where the link goes, and
what you click to go there. One possible destination for a hyperlink is a named location
inside an HTML document.
 The <a> tag can also be used to define these locations in a special usage known as
setting a fragment identifier, although the term marker might make more sense.
 To set a marker, set the name to a symbolic name for the marker location. The
defined name must be unique within the document.
 Wherever the marker is placed within an HTML document becomes a named
candidate destination for hyperlinks.
 For example, the HTML markup <a name="marker"> This is a marker</a> sets the
text "This is a marker" to be associated with the fragment identifier #marker.
 In practice, when an <a> tag is used solely as a marker, it often doesn't enclose an
text.
 Their main purpose is to name a location within a document to jump to; for example,
the common "back to top" links found at the bottom of long pages.
Adding Graphics to HTML
42
To have a graphic appear on a webpage, web designers must to put the <IMG> tag in with
the address where the graphic "lives":
<IMG SRC="http://www.someplace.com/images/fish.gif">
Graphics attributes:
src:=“pathofimage”. This value will be url/path of the image
alt="text": insert a description of the graphic for those who are using browsers that
cannot process images (e.g., page readers for the blind)
width="xx/xx%": width in pixels/percentage
height="xx/xx%": height in pixels/percentage
border="xx": pixel length of the border surrounding the image.
hspace="xx": places a buffer of space horizontally around the image
vspace="xx": places a buffer of space vertically around the image
align="top/middle/bottom/right/left": aligns image in relation to the text (see next 2
slides)
Anchor Tag Attributes…
43
Title
title is very useful because it can be used to indicate some information about the link's destination.
<a href="staff/index.html" title="Resumes and information about our staff">
Staff
</a>
The title attribute serves another purpose: It provides the title information for a bookmark when a link
is bookmarked before the destination page is visited.
Accelerator Keys
With this attribute, you can set a key to invoke an anchor without requiring a pointing device to select
the link. The link is activated with the combination of the accelerator key, usually ALT, and the key
specified by the attribute. So,
<a href="http://www.yahoo.com/" accesskey="Y"> Yahoo! </a>
Target
the target attribute is left out, the current window or frame the document is in is used. Aside from
author-named frames, the following are several reserved names for frames that, when used with the
target attribute, have special meaning: _blank, _self, _parent, and _top.
Attributes of <img> tag
44
Adding Graphics to HTML Contd…
45
<img src="http://www.someplace.com/images/fish.gif" align="top">All about Fish
<img src="http://www.someplace.com/images/fish.gif" align="middle">All about Fish
<img src="http://www.someplace.com/images/fish.gif" align="bottom">All about Fish
All about Fish
All about Fish
All about Fish
Adding Graphics to HTML Contd…
46
<img src="http://www.someplace.com/images/fish.gif" align=“left">
<img src="http://www.someplace.com/images/fish.gif" align=“right">
47
Image and Anchor
<a> tags can enclose text and other content, including images. When an anchor encloses an image,
the image becomes clickable, thus providing the basic mechanism for a graphic button.
<a href="about.html"> <img src="about.gif" alt="About Button" height="55" width="55" /> </a>
Image Maps
 An image map is a large image that contains numerous hot spots that can be selected, sending
the user to a different anchor destination.
 Image maps are images, usually in gif format that have been divided into regions; clicking in a
region of the image cause the web surfer to be connected to a new URL. Image maps are
graphical form of creating links between pages
 There are two basic forms of image maps: server-side and client-side.
 In the server-side image map, the user clicks on an image but the server must decode where the
user clicked before the destination page (if any) is loaded. With client-side image maps, all of the
map information—which regions map to which URLs—can be specified in the same HTML file that
contains the image.
 Including the map data with the image and letting the browser decode it has several advantages,
including the following:
 There is no need to visit a server to determine the destination, so links are resolved faster.
 Destination URLs can be shown in the status box as the user's pointer moves over the image.
 Image maps can be created and tested locally, without requiring a server or system
administration support.
 Client-side image maps can be created so that they present an alternate text menu to users of
text-only browsers.
<TABLE></TABLE> tag
48
 A table is an orderly arrangement of data distributed across a grid of rows and columns.
Web page tables also are commonly used to structure a page for layout. In its simplest form,
a table places information inside the cells formed by dividing a rectangle into rows and
columns. Most cells contain data; some cells, usually on
 the table's top or side, contain headings.
 HTML represent a basic table using four elements.
 table tag pair, <table> … </table>, contains an optional caption element
 one or more rows, <tr> … </tr>.
 Each row contains cells holding a heading, <th> … </th>, or data, <td> .. </td>.
 A table is made up of rows enclosed within <tr> … </tr>. The number of rows in the table is
determined by the number of occurrences of the tr element.
 The number of columns in a table is determined by the maximum number of data cells in
one row indicated by <td> … </td>, or headings indicated by <th> … </th> within the table.
 The headings for the table are set using the <th> element. The table might also have a
caption enclosed within <caption> … </caption>, whose contents generally are rendered
above or below the table, indicating what the table contains.
<TABLE></TABLE> tag
49
<table border=“1”>
<tr>
<th> Column 1 header </th>
<th> Column 2 header </th>
</tr>
<tr>
<td> Row1, Col1 </td>
<td> Row1, Col2 </td>
</tr>
<tr>
<td> Row2, Col1 </td>
<td> Row2, Col2 </td>
</tr>
</table>
Column 1
Header
Column 2
Header
Row1, Col1 Row1, Col2
Row2, Col1 Row2, Col2
<TABLE></TABLE> Attributes
50
 BGColor: Some browsers support background colors in a table.
 Width: you can specify the table width as an absolute number of pixels or a percentage of
the document width. You can set the width for the table cells as well.
 Border: You can choose a numerical value for the border width, which specifies the border
in pixels.
 CellSpacing: Cell Spacing represents the space between cells and is specified in pixels
 CellPadding: Cell Padding is the space between the cell border and the cell contents and is
specified in pixels.
 Align: tables can have left, right, or center alignment.
 Background: Background Image, will be titled in IE3.0 and above.
 BorderColor, BorderColorDark.
Table Caption & Header
51
 Table Caption: A table caption allows you to specify a line of text that will appear
centered above or bellow the table.
<TABLE BORDER=1 CELLPADDING=2>
<CAPTION ALIGN=“BOTTOM”> Label For My Table </CAPTION>
The Caption element has one attribute ALIGN that can be either TOP (Above the
table) or BOTTOM (below the table).
 Table Header: Table Data cells are represented by the TD element. Cells can
also be TH (Table Header) elements which results in the contents of the table
header cells appearing centered and in bold text
Table Data & Header Attributes
52
 Colspan: Specifies how many cell columns of the table this cell should span.
 Rowspan: Specifies how many cell rows of the table this cell should span.
 Align: cell data can have left, right, or center alignment.
 Valign: cell data can have top, middle, or bottom alignment.
 Width: you can specify the width as an absolute number of pixels or a
percentage of the document width.
 Height: You can specify the height as an absolute number of pixels or a
percentage of the document height.
Example
53
<TABLE BORDER=1 width=50%>
<CAPTION> <h1>Spare Parts <h1> </Caption>
<TR><TH>Stock Number</TH><TH>Description</TH><TH>List
Price</TH></TR>
<TR><TD bgcolor=red>3476-AB</TD><TD>76mm
Socket</TD><TD>45.00</TD></TR>
<TR><TD >3478-AB</TD><TD><font color=blue>78mm Socket</font>
</TD><TD>47.50</TD></TR>
<TR><TD>3480-AB</TD><TD>80mm Socket</TD><TD>50.00</TD></TR>
</TABLE>
Example
54
<Table border=1 cellpadding =2>
<tr>
<th> Column 1 Header</th>
<th> Column 2 Header</th>
</tr>
<tr>
<td colspan=2> Row 1 Col 1</td>
</tr>
<tr>
<td rowspan=2>Row 2 Col 1</td>
<td> Row 2 Col2</td>
</tr>
<tr> <td> Row 3 Col2</td> </tr>
</table>
Column 1
Header
Column 2
Header
Row 1 Col 1
Row 2 Col 1
Row 2 Col 2
Row 3 Col 2
Example
55
<TABLE BORDER width=“750”>
<TR> <TD colspan=“4” align=“center”>Page Banner</TD></TR>
<TR>
<TD rowspan=“2” width=“25%”>Nav Links</TD>
<TD colspan=“2”>Feature Article</TD>
<TD rowspan=“2” width=“25%”>Linked Ads</TD>
</TR>
<TR><TD width=“25%”>News Column 1 </TD> <TD width=“25%”><News
Column 2 </TD></TR>
</TABLE>
Output:
56
Important Points about Table
57
● TH, TD and TR should always have end tags.
Although the end tags are formally optional, many browsers will mess up the
formatting of the table if you omit the end tags. In particular, you should always
use end tags if you have a TABLE within a TABLE -- in this situation, the table
parser gets hopelessly confused if you don't close your TH, TD and TR
elements.
● A default TABLE has no borders
By default, tables are drawn without border lines. You need the BORDER
attribute to draw the lines.
● By default, a table is flush with the left margin
TABLEs are plopped over on the left margin. If you want centered tables, You
can either: place the table inside a DIV element with attribute ALIGN="center".
Most current browsers also supports table alignment, using the ALIGN attribute.
Allowed values are "left", "right", or "center", for example: <TABLE
ALIGN="left">. The values "left" and "right" float the table to the left or right of the
page, with text flow allowed around the table. This is entirely equivalent to IMG
alignment
Frame in HTML
58
● A framed document divides a browser window into multiple panes, or smaller window
frames. Each frame can contain a different document.
● The benefits of this approach are obvious: users can view information in one frame while
keeping another frame open for reference instead of moving back and forth between pages.
The contents of one frame can be manipulated, or linked, to the contents of another.
● A frame is an independent scrolling region, or window, of a Web page. Every Web page can
be divided into many individual frames, which can even be nested within other frames.
● Of course, fixed screen sizes limit how many frames can realistically be used
simultaneously. Each frame in a window can be separated from the others with a border.
● Individual frames usually are named so that they can be referenced through links or
scripting, allowing the contents of one frame to affect the contents of another. This
referencing capability is a major difference between tables and frames. Frames provide
layout facilities and, potentially, navigation
Frame in HTML
59
 Within the framing document, the frameset element defines the set of frames that makes up the document.
The major attributes of this element are:
 Rows: <frameset rows="10%, 80%, 10%">
 Cols: <frameset cols="20%, 80%">
 Use the wildcard character (*) to specify that whatever is left over after 175 pixels should be used for the
other frame. The code for such a frameset is
 <frameset cols="175,*">.
 Within the frameset element, individual <frame> tags are used to specify the documents that are placed
within the rows or columns defined by the frameset element.
 The basic syntax of the <frame> tag is
 <frame src="URL" name="unique frame name" id="unique frame name">.
 e.g
<frameset rows="30%,30%,40%">
<frame src="header.html" name="header" >
<frame src="display.html" name="display" >
<frame src="footer.html" name="footer" >
</frameset>
Frame in HTML
60
 For Example to make a framed page with a windowpane on the left and one on the right requires three
HTML pages. Doc1.html and Doc2.html are the pages that contain content. Frames.html is the page that
describes the division of the single browser window into two windowpanes.
Frame-Page Architecture
61
 A <FRAMESET> element is placed in the html document before the <BODY> element. The <FRAMESET>
describes the amount of screen real estate given to each windowpane by dividing the screen into ROWS or
COLS.
 The <FRAMESET> will then contain <FRAME> elements, one per division of the browser window.
Note: Because there is no BODY container, FRAMESET pages can't have background images and background
colors associated with them
<HTML>
<HEAD>
<TITLE> Framed Page </TITLE>
<FRAMESET COLS=“23%,77%”>
<FRAME SRC=“Doc1.html”>
<FRAME SRC=“Doc2.html”>
</FRAMESET >
</HEAD>
</HTML>
Frame-Page Architecture
62
frameborder
The default value of 1 indicates a frame border should be used while a value of 0 indicates to remove it.
So <frame src="links.html" name="controls" id="controls“ frameborder="0"> would turn off borders for this particular frame.
Framespacing (frameset)
Internet Explorer has added a proprietary attribute, framespacing, to the frameset element to alleviate this. Just set it to 0
and any gaps should be removed under this browser.
Scrolling
To set scrolling on a frame, use the scrolling attribute on a <frame> tag; by default, the value of this attribute is auto, which
adds scrollbars as needed. However, setting the value to yes or no will explicitly indicate the presence or lack of scrollbars
regardless of the content within the frame.
Noresize
The presence of the noresize attribute indicates that the user cannot resize a frame.
marginheight and marginwidth
These attributes are used to control the distance between the frame and its contents. Very often designers will set these
values to 0 to achieve the effect of bleeding framed content right to the edge of the frame.
<frame src="blue.html" name="right" id="right" marginwidth="0" marginheight="0“ >
The Use of <noframes>
The <noframes> tag should contain the markup and text to be displayed when a browser that doesn't support frames
accesses the Web page. The <noframes> tag should be found only within the frameset element.
63
Example of frameset
<frameset cols="20%, 80%">
<frame src="links.html" name="links" id="links”>
<frame src="display.html" name="display" id="display”>
<noframes>
<body>
<p>This document uses frames. Please follow this link to a
<a href="noframes.html">no frames</a> version.
</p>
</body>
</noframes>
</frameset>
64
The problems with frames are numerous, and include problems with design, navigation, bookmarking, URL context,
search engine compatibility, and printing.
● Navigation problems include loss of context because the URL of the document, as displayed in the address
bar of the browser, does not change when using frames; this accounts for why bookmarking doesn't work as
expected because a bookmark just records a document's URL.
● If they try to bookmark the page, their bookmark will open the frameset with its original pages loaded (frameset
home page), not the one you had loaded inside when you created the bookmark.
● Browser Problem :For years there were a considerable amount of browsers in use that could not access
framed pages, and were restricted to viewing whatever the author had placed in the <noframes> section of their
code.
● Printing Problems : Browsers have had a long-standing problem with printing framed pages. Often you would
get only one of the component pages printed off, or have everything scrunched together in a mess. The most
recent browsers have given you options on whether you want the full frameset printed or an individual page, but
that doesn’t escape the fact that printing framed pages is unnecessarily tricky and problematic.
● Viewing the source code of a page is also made redundant since the frameset code appears where many
inexperienced users would expect a large amount of useful code. You can click inside a frame and extract the
code from it, but the fact remains, it goes against user’s expectations.
Frameset Limitations
65
 Another form of frame, known as a floating frame but more appropriately called an inline frame, was initially
introduced by Microsoft but has been incorporated into the HTML standards.
 The idea of the floating frame is to create an inline framed region, or window, that acts similarly to any other
embedded object, insofar as text can be flowed around it.
 An inline frame is defined by the <iframe>…</iframe> element and can occur anywhere within the <body> of an
HTML document.
 Compare this to the frame element that should occur only within the frameset element.
Attributes of <iframe>
● Src :The src is set to the URL of the file to load,
● height & width: height and width are set either to the pixel or percentage value of the screen that the floating
frame region should consume.
● Align: For basic positioning within the flow of text.
● marginheight and marginwidth: Control the margins on framed content.
● Internet Explorer supports the addition of the hspace and vspace attributes as well. although the HTML and
XHTML specification does not.
Floating Frame (Inline Frame) <iframe></iframe>
66
<html >
<body>
<h1 align="center">Floating Frame Example</h1>
<iframe src="file1.html" name="iframe1“ width="350"
height="200" align="left">
There would be a floating frame here if your browser
supported it.
</iframe>
<p>This is a simple example of how floating frames are
used. Notice that in
many ways the floating frame acts very similar to an
inline image.
Floating frames act like embedded objects in many
ways.
</p>
</body>
</html>
Example of <iframe>

Mais conteúdo relacionado

Mais procurados

Mais procurados (18)

HTML- Hyper Text Markup Language
HTML- Hyper Text Markup LanguageHTML- Hyper Text Markup Language
HTML- Hyper Text Markup Language
 
Html book2
Html book2Html book2
Html book2
 
What is html xml and xhtml
What is html xml and xhtmlWhat is html xml and xhtml
What is html xml and xhtml
 
HTML (Hyper Text Markup Language)
HTML (Hyper Text Markup Language)HTML (Hyper Text Markup Language)
HTML (Hyper Text Markup Language)
 
RoboHelp 2002 - overview
RoboHelp 2002 - overviewRoboHelp 2002 - overview
RoboHelp 2002 - overview
 
Web topic 2 html
Web topic 2  htmlWeb topic 2  html
Web topic 2 html
 
Html tutorial
Html tutorialHtml tutorial
Html tutorial
 
Html
HtmlHtml
Html
 
1 introductin to HTML
1 introductin to HTML1 introductin to HTML
1 introductin to HTML
 
HTML & JAVA Script
HTML & JAVA ScriptHTML & JAVA Script
HTML & JAVA Script
 
Html
HtmlHtml
Html
 
Cse html ppt
Cse html pptCse html ppt
Cse html ppt
 
Web design in 7 days by waqar
Web design in 7 days by waqarWeb design in 7 days by waqar
Web design in 7 days by waqar
 
Html b smart
Html b smartHtml b smart
Html b smart
 
The Difference between HTML, XHTML & HTML5 for Beginners
The Difference between HTML, XHTML & HTML5 for BeginnersThe Difference between HTML, XHTML & HTML5 for Beginners
The Difference between HTML, XHTML & HTML5 for Beginners
 
Hyper Text Mark-up Language
Hyper Text Mark-up Language Hyper Text Mark-up Language
Hyper Text Mark-up Language
 
Web Site Designing - Basic
Web Site Designing - Basic Web Site Designing - Basic
Web Site Designing - Basic
 
Introduction to html (912 kb)
Introduction to html (912 kb)Introduction to html (912 kb)
Introduction to html (912 kb)
 

Semelhante a HTML Structure & Tags

Grade 7_HTML.pptx
Grade 7_HTML.pptxGrade 7_HTML.pptx
Grade 7_HTML.pptxshilpak0307
 
ITEC229_Chapter2_new.ppt
ITEC229_Chapter2_new.pptITEC229_Chapter2_new.ppt
ITEC229_Chapter2_new.pptDowntownWannabe
 
Tutorial 08 - Creating Effective Web Pages
Tutorial 08 - Creating Effective Web PagesTutorial 08 - Creating Effective Web Pages
Tutorial 08 - Creating Effective Web Pagesdpd
 
CreatingWebPages-Part1.ppt
CreatingWebPages-Part1.pptCreatingWebPages-Part1.ppt
CreatingWebPages-Part1.pptHamzaAhmad861123
 
Html5 Introduction For Beginners
Html5 Introduction For BeginnersHtml5 Introduction For Beginners
Html5 Introduction For BeginnersAriful Islam
 
Web Design L1 - Untagling the Web
Web Design L1 - Untagling the WebWeb Design L1 - Untagling the Web
Web Design L1 - Untagling the Webmykella
 
introdution-to-html.ppt coding programming
introdution-to-html.ppt coding programmingintrodution-to-html.ppt coding programming
introdution-to-html.ppt coding programmingprogramizconsultancy
 
CSE-HTML-PPT.pptx
CSE-HTML-PPT.pptxCSE-HTML-PPT.pptx
CSE-HTML-PPT.pptxAmbika S
 
Introduction to Web Development - HTML
Introduction to Web Development - HTMLIntroduction to Web Development - HTML
Introduction to Web Development - HTMLSadhanaParameswaran
 
What are new added in HTML5?
What are new added in HTML5?What are new added in HTML5?
What are new added in HTML5?Chetu
 

Semelhante a HTML Structure & Tags (20)

Lecture-1.pptx
Lecture-1.pptxLecture-1.pptx
Lecture-1.pptx
 
Grade 7_HTML.pptx
Grade 7_HTML.pptxGrade 7_HTML.pptx
Grade 7_HTML.pptx
 
WHAT IS HTML.pdf
WHAT IS HTML.pdfWHAT IS HTML.pdf
WHAT IS HTML.pdf
 
WHAT IS HTML.pdf
WHAT IS HTML.pdfWHAT IS HTML.pdf
WHAT IS HTML.pdf
 
WHAT IS HTML.pdf
WHAT IS HTML.pdfWHAT IS HTML.pdf
WHAT IS HTML.pdf
 
ITEC229_Chapter2_new.ppt
ITEC229_Chapter2_new.pptITEC229_Chapter2_new.ppt
ITEC229_Chapter2_new.ppt
 
Module 1
Module 1Module 1
Module 1
 
Tutorial 08 - Creating Effective Web Pages
Tutorial 08 - Creating Effective Web PagesTutorial 08 - Creating Effective Web Pages
Tutorial 08 - Creating Effective Web Pages
 
Html.pptx
Html.pptxHtml.pptx
Html.pptx
 
CreatingWebPages-Part1.ppt
CreatingWebPages-Part1.pptCreatingWebPages-Part1.ppt
CreatingWebPages-Part1.ppt
 
Html5 Introduction For Beginners
Html5 Introduction For BeginnersHtml5 Introduction For Beginners
Html5 Introduction For Beginners
 
Basics of HTML..pptx
Basics of HTML..pptxBasics of HTML..pptx
Basics of HTML..pptx
 
Web Design L1 - Untagling the Web
Web Design L1 - Untagling the WebWeb Design L1 - Untagling the Web
Web Design L1 - Untagling the Web
 
Dynamic html (#1)
Dynamic  html (#1)Dynamic  html (#1)
Dynamic html (#1)
 
introdution-to-html.ppt coding programming
introdution-to-html.ppt coding programmingintrodution-to-html.ppt coding programming
introdution-to-html.ppt coding programming
 
CSE-HTML-PPT.pptx
CSE-HTML-PPT.pptxCSE-HTML-PPT.pptx
CSE-HTML-PPT.pptx
 
Introduction to Web Development - HTML
Introduction to Web Development - HTMLIntroduction to Web Development - HTML
Introduction to Web Development - HTML
 
Html5
Html5Html5
Html5
 
What are new added in HTML5?
What are new added in HTML5?What are new added in HTML5?
What are new added in HTML5?
 
HTML
HTMLHTML
HTML
 

Mais de Jaya Kumari

Python data type
Python data typePython data type
Python data typeJaya Kumari
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonJaya Kumari
 
Variables in python
Variables in pythonVariables in python
Variables in pythonJaya Kumari
 
Basic syntax supported by python
Basic syntax supported by pythonBasic syntax supported by python
Basic syntax supported by pythonJaya Kumari
 
Decision statements
Decision statementsDecision statements
Decision statementsJaya Kumari
 
Loop control statements
Loop control statementsLoop control statements
Loop control statementsJaya Kumari
 
Looping statements
Looping statementsLooping statements
Looping statementsJaya Kumari
 
Operators used in vb.net
Operators used in vb.netOperators used in vb.net
Operators used in vb.netJaya Kumari
 
Variable and constants in Vb.NET
Variable and constants in Vb.NETVariable and constants in Vb.NET
Variable and constants in Vb.NETJaya Kumari
 
Keywords, identifiers and data type of vb.net
Keywords, identifiers and data type of vb.netKeywords, identifiers and data type of vb.net
Keywords, identifiers and data type of vb.netJaya Kumari
 
Introduction to vb.net
Introduction to vb.netIntroduction to vb.net
Introduction to vb.netJaya Kumari
 
Frame class library and namespace
Frame class library and namespaceFrame class library and namespace
Frame class library and namespaceJaya Kumari
 
Introduction to .net
Introduction to .net Introduction to .net
Introduction to .net Jaya Kumari
 
Java script Basic
Java script BasicJava script Basic
Java script BasicJaya Kumari
 
Java script Advance
Java script   AdvanceJava script   Advance
Java script AdvanceJaya Kumari
 

Mais de Jaya Kumari (20)

Python data type
Python data typePython data type
Python data type
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Variables in python
Variables in pythonVariables in python
Variables in python
 
Basic syntax supported by python
Basic syntax supported by pythonBasic syntax supported by python
Basic syntax supported by python
 
Oops
OopsOops
Oops
 
Inheritance
InheritanceInheritance
Inheritance
 
Overloading
OverloadingOverloading
Overloading
 
Decision statements
Decision statementsDecision statements
Decision statements
 
Loop control statements
Loop control statementsLoop control statements
Loop control statements
 
Looping statements
Looping statementsLooping statements
Looping statements
 
Operators used in vb.net
Operators used in vb.netOperators used in vb.net
Operators used in vb.net
 
Variable and constants in Vb.NET
Variable and constants in Vb.NETVariable and constants in Vb.NET
Variable and constants in Vb.NET
 
Keywords, identifiers and data type of vb.net
Keywords, identifiers and data type of vb.netKeywords, identifiers and data type of vb.net
Keywords, identifiers and data type of vb.net
 
Introduction to vb.net
Introduction to vb.netIntroduction to vb.net
Introduction to vb.net
 
Frame class library and namespace
Frame class library and namespaceFrame class library and namespace
Frame class library and namespace
 
Introduction to .net
Introduction to .net Introduction to .net
Introduction to .net
 
Jsp basic
Jsp basicJsp basic
Jsp basic
 
Java script Basic
Java script BasicJava script Basic
Java script Basic
 
Sgml and xml
Sgml and xmlSgml and xml
Sgml and xml
 
Java script Advance
Java script   AdvanceJava script   Advance
Java script Advance
 

Último

Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 

Último (20)

Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 

HTML Structure & Tags

  • 1. Internet & Web Designing BCA -302
  • 2. Unit-2 : Introduction to HTML 2 Learning Objectives Introduction to design a static web-page using HTMl Tag How to design web page according to a structure Overview of HTML Tags , attributes, etc.
  • 3. 3 Unit-2 : Introduction to HTML • Basic concept • HTML tags • Commonly used HTML Commands • Title & Footers • Text Formatting • Text Styles • Lists • Adding Graphics to HTML Documents • Linking Documents • Tables • Frames
  • 4. Introduction to HTML  HTML is an acronym which 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.  Markup language: A markup language is a computer language that is used to apply layout and formatting conventions to a text document. Markup language makes text more interactive and dynamic. It can turn text into images, tables, links, etc.  Web Page: A web page is a document which is commonly written in HTML and translated by a web browser. A web page can be identified by entering an URL. A Web page can be of the static or dynamic type. With the help of HTML only, we can create static web pages. Hence, HTML is a markup language which is used for creating attractive web pages with the help of styling, and which looks in a nice format on a web browser. 4
  • 5. Introduction to HTML  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.  Originally, HTML was developed with the intent of defining the structure of documents like headings, paragraphs, lists, and so forth to facilitate the sharing of scientific information between researchers. Now, HTML is being widely used to format web pages with the help of different tags available in HTML language  Extension of HTML file is .htm or .html 5
  • 6. HTML Version Since the time HTML was invented there are lots of HTML versions in market, the brief introduction about the HTML version is given below: ● HTML 1.0: The first version of HTML was 1.0, which was the barebones version of HTML language, and it was released in1991. ● 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 style sheets (CSS) and scripting ability for various multimedia elements. ● HTML5 : HTML5 is the newest version of Hyper Text 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. 6
  • 7. Features of HTML 1. It is a very easy and simple language. It can be easily understood and modified. 2. It is very easy to make an effective presentation with HTML because it has a lot of formatting tags. 3. It is a markup language, so it provides a flexible way to design web pages along with the text. 4. It facilitates programmers to add a link on the web pages (by html anchor tag), so it enhances the interest of browsing of the user. 5. It is platform-independent because it can be displayed on any platform like Windows, Linux, and Macintosh, etc. 6. It facilitates the programmer to add Graphics, Videos, and Sound to the web pages which makes it more attractive and interactive. 7. HTML is a case-insensitive language, which means we can use tags either in lower-case or upper-case 7
  • 8. Advantages of HTML ● Create Web site - You can create a website or customize an existing web template if you know HTML well. ● Become a web designer - If you want to start a carrer as a professional web designer, HTML and CSS designing is a must skill. ● Understand web - If you want to optimize your website, to boost its speed and performance, it is good to know HTML to yield best results. ● Learn other languages - Once you understands the basic of HTML then other related technologies like javascript, php, or angular are become easier to understand. 8
  • 9. Application of HTML ● Web pages development - HTML is used to create pages which are rendered over the web. Almost every page of web is having html tags in it to render its details in browser. ● Internet Navigation - HTML provides tags which are used to navigate from one page to another and is heavily used in internet navigation. ● Responsive UI - HTML pages now-a-days works well on all platform, mobile, tabs, desktop or laptops owing to responsive design strategy. ● Offline support HTML pages once loaded can be made available offline on the machine without any need of internet. ● Game development- HTML5 has native support for rich experience and is now useful in gaming developent arena as well. 9
  • 10. HTML Editors ● 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 can be directly downloaded, but for a beginner, the best text editor is Notepad (Windows) or TextEdit (Mac). ● After learning the basics, one can easily use other professional text editors which are, Notepad++, Sublime Text, Vim, etc. 10
  • 11. Building Blocks of HTML An HTML document consist of its basic building blocks which are: ● Tags: An HTML tag surrounds the content and apply meaning to it. It is written between < and > brackets. ● Attribute: An attribute in HTML provides extra information about the element, and it is applied within the start tag. An aHTML attribute contains two fields: name & value. ● Elements: An HTML element is an individual component of an HTML file. In an HTML file, everything written within tags are termed as HTML elements. An HTML element is defined by a start tag, some content, and an end tag: <tagname>Content goes here...</tagname> 11
  • 12. overview of the structure of HTML elements Structure of HTML <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title> Document Title Goes Here </title> ...Head information describing the document .... </head> <body> ...Document content and markup go here.... </body> </html> 12
  • 13. overview of the structure of HTML elements HTML Documents All HTML documents must start with a document 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>. The <!DOCTYPE> Declaration:The <!DOCTYPE> declaration represents the document type, and helps browsers to display web pages correctly. It must only appear once, at the top of the page (before any HTML tags). <html>:This tag encloses the complete HTML document and mainly comprises of document header which is represented by <head>...</head> and document body which is represented by <body>...</body> tags <head> This tag represents the document's header which can keep other HTML tags like <title>, <link> etc. <title> The <title> tag is used inside the <head> tag to mention the document title. <body> This tag represents the document's body which keeps other HTML tags like <h1>, <div>, <p> etc 13
  • 14. 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.  HTML tags contain three main parts: opening tag, content and closing tag. But some HTML tags are unclosed tags.  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.  An HTML file must have some essential tags so that web browser can differentiate between a simple text and HTML text.  One can use as many tags as per the code requirement.  All HTML tags must enclosed within < > these brackets.  Every tag in HTML perform different tasks. 14
  • 15. Types of HTML Tags  Paired tags : Paired tags have an opening and closing tag. The opening tag is similar to the single tag and the closing has first slash. (<html></html>, <p></p>,etc.)  Singular Tags / Un-paired tags: A tag is set to be a singular tag when there is no closing tag for that or Tag is said to be singular tag when there is no companion tag. For example, we have only one tag which doesn’t require any closing tag and it must always be a single tag, that is why it’s called singular tag Singular Tags are also called: Unpaired Tags, Standalone tag, Tag without companion tag. (<br/>, <hr/>, etc.)  Meta Tags: Meta Tags are those tags which are used in the <head> section of the website, which provides relative data about the web-page to the search engine.  Self-Closing Tags: Self-Closing Tags are those HTML tags that do not have a partner tag, where the first tag is the only necessary tag that is valid for the formatting. The main and important information is contained WITHIN the element as its attribute. An image tag is the classic example of a self-closing tag.  Utility Based Tag: The HTML tags can be widely differentiated on the basis of their utility, that is, on the basis of the purpose they serve. We can divide them basically into three categories as formatting tag, structure tags, control tags 15
  • 16. Commonly used HTML Tags  <HTML> </HTML>  <HEAD></HEAD>  <TITLE></TITLE>  <BODY></BODY>  HEADING TAG : Used for marking sections and subsections in a document. ( <H1></H1>, <H2></H2>, <H3></H3>, <H4></H4>, <H5></H5>, <H6></H6> ) 16
  • 17. <HTML ></HTML> Tag  The <html> tag delimits the beginning and the end of an HTML document.  Given that <html> is the common ancestor of an HTML document it is often called the root element, as it is the root of an inverted tree structure containing the tags and content of a document.  The <html> tag, however, directly contains only the <head> tag, the <body> tag, and potentially the <frameset> tag instead of the <body> tag.  The <html> tag's typical use in a document is as a container for all other elements. 17  The information in the head of an HTML document is very important because it is used to describe or augment the content of the document.  In many cases, the information contained within the <head>tag is information about the information of the page, which generally is referred to as meta-information.  This is a very important and often overlooked aspect of HTML documents. Search engines use meta-information to index Web pages.  Aside from meta-information, the head element can include author contact information, scripts, style sheets, comments—and, most importantly, a page title. <HEAD></HEAD> Tag
  • 18. <TITLE></TITLE> Tag  The most important head element is the title element, which most browsers display in a title bar at the top of the browser window.  The document title is actually the only tag required under traditional HTML specifications and should occur as the first element within the head element.  Regardless of specification variations, the <title> tag must be used in every HTML document as it gives an HTML document a title by which it is known to browsers and indexing robots.  Browsers display the document title while the document is being viewed, and might also use the title in bookmark lists.  Search engines that index the Web often place special meaning on the contents of the title element when determining what a page is about. Because of this, a title should indicate the contents of a page without ambiguity.  While titles should be descriptive, they should also be concise. Authors should limit title length to a reasonable number of characters. 18
  • 19. Other Head Elements In addition to the title element within the head element include base, isindex, link, meta, object, script, and style.  The <base> tag specifies an absolute URL address that is used to provide server and directory information for partially specified URL addresses called relative links used within the document.  The <isindex> tag indicates that the document contains a searchable index. It causes the browser to display a query prompt and a field for entering a query.  The <link> tag specifies a special relationship between the current document and another document. It can be used in hypertext navigational relationships including prefetching of documents by browsers.  The <meta> tag uses name/value pairs to provide meta-information about a document. The <meta> element often provides descriptive information targeted by Web search engines. In a very different use, the <meta> tag can define various HTTP request values such as a page refresh or an expiration time. 19
  • 20. Other Head Elements contd…  The <object> tag allows programs and other binary objects to be directly embedded in a Web page. The most popular current approaches use Java applets, plug-ins, or ActiveX controls to embed multimedia elements such as Flash animations, sounds, or movies.  The <script> tag allows programs written in a scripting language to be directly embedded in a Web page. The most popular scripting language in Web documents is JavaScript, which is somewhat standardized in the form of ECMAScript, although few Web practitioners refer to it as that. The script element and associated usage of scripts, often dubbed Dynamic HTML (DHTML) because it allows HTML elements to be modified dynamically, should simply be considered a form of client-side scripting.  The <style> tag encloses document-wide style specifications relating to fonts, colors, positioning, and other aspects of content presentation. Today, the primary style sheet technology used in Web pages is called Cascading Style Sheets (CSS). 20
  • 21. <BODY></BODY> Tag  After the head section, the body of a document is delimited by <body> and </body>.  Only one body element can appear per document. Because the body element delimits the document itself, its attributes are primarily used to effect change across the entire document, such as setting background images, background colors, and link and text color.  When you create a Web page, you can change several things in the body of your document by adding attributes to the <body> tag. <body bgcolor="black" text="red" link="yellow" alink="orange" vlink="white“ background="image.gif">  We can use as many or as few of these attributes as we wish. The options we don't use will be set to the Web browser's default values. 21
  • 23. Text & Paragraph Formatting Tag 23 <p></p>  Surrounding text with the <p> and </p> tags indicates that the text is a logical paragraph unit.  On encountering this tag the browser, moves onto the new line, skipping one or two line between the previous line and the new line depends on the browser and any applied style sheet.  The align attribute of <p> makes it possible to specify a left, right, center or justify alignment.  Web browser ignore multiple consecutive <p> tags. <p align=”value”>………</p> <br>  This tag inserts a single carriage return or line break into a document.  It is an empty element—thus, it has no close tag.  Browser recognize multiple consecutive <br> tags.  The one attribute commonly used with a <br> tag is clear. This attribute controls how text flows around images or embedded objects
  • 24. Text & Paragraph Formatting Tag Contd.. 24 <hr> <hr align="left" width="100" size=”10” noshade=”noshade”> As sections are added to an HTML document, it is often useful to break up the document into visually/logically distinct sections. A horizontal rule, indicated by the <hr> tag, is an empty block- level element that serves this purpose. Different attributes of <hr> : 1. The size attribute sets the bar's thickness (height) in pixels. 2. The width attribute sets the width of the rule. It can be set to a fixed number of pixels, or to a percentage of the available screen width. 3. The align attribute sets its alignment to left, right, or center (default). 4. The noshade attribute renders the bar without a surrounding shadow. 5. The color attributes specifies the color of the rule.
  • 25. Text & Paragraph Formatting Tag Contd.. 25 Bold Text (<b>…</b> ) Displays text in BOLDFACE Style. The tags used are <B>..</B> Italic Text (<i>…</i>) Displays text in Italic. The tags used are <I>…</I> Underline (<u>…</u>) Displays text as underlined, the tags used are <U>…</U> <big>…<big> Enclosing content within a <big> tag pair makes it one size bigger. <small> … </small> Displays text with one smaller size. <sup>…</sup> The <sup> tag defines superscript text. Superscript text appears half a character above the baseline. Superscript text can be used for footnotes, like 𝑎2 + 𝑏2 = 𝑐2 . <sub>…</sub> The <sub> tag defines subscript text. Subscript text appears half a character below the baseline. Subscript text can be used for chemical formulas, like H2O.
  • 26. Text & Paragraph Formatting Tag Contd.. 26 <abbr>…</abbr> <abbr title="United Nations">UN</abbr> <acronym>…</acronym> <acronym title="World Wide Web">WWW</acronym> The <center> Tag (<center>…</center>) <center>… </center> tags are used to center everything found between them- text, lists, images, rules, tables or any other page element. <center>I am centered!</center> Fonts The basic syntax of <font> <font color="color value" size="size value from 1-7" face="list of font faces"> styled text here </font> Given this syntax using <font>, you can set the color attribute equal to a valid color name such as "red" or an equivalent hex value such as #FF0000 to color text. e.g. <p><font color="red">This is red.</font> This is not.</p>
  • 27. Text & Paragraph Formatting Tag Contd.. 27 <address>… </address>  The <address> tag defines the contact information for the author/owner of a document or an article.  If the <address> element is inside the <body> element, it represents contact information for the document.  If the <address> element is inside an <article> element, it represents contact information for that article.  The text in the <address> element usually renders in italic. <CITE> Citations </CITE> Citations <CODE> Source Code </CODE> Source Code
  • 28. Text AnimationTag 28 <blink> Its simple goal is to make text blink: <blink> Buy now! </blink> <marquee> To create messages that scroll and slide across a viewer's screen in a variety of different ways. Using the element is simple; just enclose some text in it and it is transformed into a scrolling ticker tape, similar to the one found at Times Square. <marquee> Welcome to MKICS. </marquee>
  • 29. Text Animation Tag contd… 29 <marquee bgcolor="yellow“ behavior="alternate“ direction="right“ loop="6” scrollamount="1” scrolldelay="40“ title="Silly tags aren't just for Netscape anymore.“ width="80%">Welcome to MKICS</marquee> Changing the attributes will adjust the presentation of the marquee.  The behavior attribute may be set to alternate, scroll, or slide.  The direction attribute is used to set the direction in which the scrolled text moves. The allowed values for this attribute are down, left, right, and up.  The loop attribute is used to set the number of times that the message loops in the scroll region. By default, unless the behavior is set to slide, a marquee scrolls forever. The value of the loop attribute should be a positive integer.  Setting scrollamount to a particular number of pixels allows the smoothness of the scroll to be controlled. The value of the scrollamount attribute is set to the number of pixels between each drawing of the scrolled message in the display area. The larger the value in pixels, the less smooth the scroll.  The scrolldelay attribute is used to set the number of milliseconds between each rendering of the scrolled message. A higher value for this attribute slows the scrolling. A reasonable value for this attribute is 50 or greater. Lower values for scrolldelay tend tom produce marquees that are very difficult to read.
  • 30. Comment in HTML 30 The contents of HTML comments are not displayed within a browser window. Comments are denoted by a start value of <!-- and an end value of -->. Comments can be many lines long. For example, <!– This is a Comment. Comment will not be displayed -->
  • 31. List in HTML 31 There are three basic forms of list 1. Ordered List <ol> (Numbering) 2. Un-ordered List <ul> (Bullets) 3. Definition List <dl>
  • 32. Ordered List in HTML 32  An ordered list, as enclosed by <ol> and </ol>, defines a list in which order matters.  Ordering typically is rendered by a numbering scheme, using Arabic numbers, letters, or Roman numerals.  Ordered lists are suitable for creating simple outlines or step-by-step instructions because the list items are automatically numbered by the browser. <ol> <li> Item 1 </li> <li> Item 2 </li> <li> Item 3 </li> </ol>
  • 33. Attributes of Ordered List in HTML 33 type The type attribute of <ol> can be set to : a for lowercase letters A for uppercase letters i for lowercase Roman numerals I for uppercase Roman numerals 1 for regular numerals ( 1 is the default value) Each <li> tag can have a local type attribute set to a, A, i, I, or 1. start  The <ol> element also has a start attribute that takes a numeric value to begin the list numbering.  Whether the type attribute is a letter or a numeral, the start value must be a number. To start ordering from the letter j, you would use <ol type="a" start="10"> because j is the tenth letter.  Lists can be nested. For e.g. <ol> <li> Item 1 </li> <ol type=“a”> > <li> Item1 a </li> <li> Item1 b </li> </ol> <li Item 2 </li> <li> item3 </li> </ol>
  • 34. Types of Ordered List in HTML 34 TYPE Numbering Styles 1 Arabic numbers 1,2,3, …… a Lower alpha a, b, c, …… A Upper alpha A, B, C, …… i Lower roman i, ii, iii, …… I Upper roman I, II, III, ……
  • 35. Un-Ordered List in HTML 35  An unordered list, signified by <ul> and </ul>, is used for lists of items in which the ordering is not specific.  A browser typically adds a bullet of some sort (a filled circle, a square, or an empty circle) for each item and indents the list.  Like ordered lists, unordered lists can be nested. type Atrribute  The type attribute can be used to set the bullet type for a list.  The allowed values for type are: disc , circle, square.  Like ordered lists, unordered lists can be nested. However, in this case each level of nesting indents the list farther, and the bullet changes accordingly. Generally, a filled circle or solid round bullet is used on the first level of lists. An empty circle is used for the second-level list. Third-level nested lists generally use a square. For e.g. <ul> <li> Item 1 </li> <li Item 2 </li> <li> item3 </li> </ol>
  • 36. Definition List in HTML 36 A definition list is a list of terms paired with associated definitions—in other words, a glossary. Definition lists are enclosed within <dl> and </dl>. Each term being defined is indicated by a <dt> element, which is derived from "definition term.“ Each definition itself is defined by <dd>. For e.g. <dl> <dt> item1 </dt> <dd> Description of item1 </dd> <dt> item2 </dt> <dd> Description of item2 </dd> </dl>
  • 37. What will be the output ? 37 <H1 ALIGN="CENTER">SAFETY TIPS FOR CANOEISTS</H1> <OL TYPE=“a” START=“2”> <LI>Be able to swim </LI> <LI>Wear a life jacket at all times </LI> <LI>Don't stand up or move around. If canoe tips, <UL> <LI>Hang on to the canoe </LI> <LI>Use the canoe for support and </LI> <LI>Swim to shore </UL> </LI> <LI>Don't overexert yourself </LI> <LI>Use a bow light at night </LI> </OL>
  • 39. Adding Links to HTML- Anchor Tag<a></a> 39  In HTML, the main way to define hyperlinks is with the anchor tag, <a>.  A link is simply a unidirectional pointer from the source document that contains the link to some destination.  In hypertext, the end points of a link typically are called anchors, thus the use of the anchor nomenclature in HTML documentation.  For linking purposes, the <a> tag requires one attribute:  href. The href attribute is set to the URL of the target resource, which basically is the address of the document to link to, such as http://www.yahoomail.com.  The text enclosed by an a element specifies a "hot spot" to activate the hyperlink.  Anchor content can include text, images, or a mixture of the two.  A general link takes the form <a href="URL">Visit our site</a>.  The text "Visit our site" is the link. The URL specified in the href attribute is the  destination if the link is activated.  The following is an example of simple link usage: <a href="http://www.yahoo.com"> Yahoo! </a>
  • 40. Anchor Tag<a></a> contd… 40  In most browsers, text links are indicated by underlined text. Text is blue if the destination has never been visited, purple if it has been visited, and briefly red as the link is activated.  If a link includes an image, the border of the image also will be blue or purple, unless the border attribute has been set to zero.  HTML authors can override these default link colors with changes to the link, alink, and vlink attributes of the body element.
  • 41. Anchor Tag Attributes… 41 Name  An <a> tag usually defines a hyperlink's source location: where the link goes, and what you click to go there. One possible destination for a hyperlink is a named location inside an HTML document.  The <a> tag can also be used to define these locations in a special usage known as setting a fragment identifier, although the term marker might make more sense.  To set a marker, set the name to a symbolic name for the marker location. The defined name must be unique within the document.  Wherever the marker is placed within an HTML document becomes a named candidate destination for hyperlinks.  For example, the HTML markup <a name="marker"> This is a marker</a> sets the text "This is a marker" to be associated with the fragment identifier #marker.  In practice, when an <a> tag is used solely as a marker, it often doesn't enclose an text.  Their main purpose is to name a location within a document to jump to; for example, the common "back to top" links found at the bottom of long pages.
  • 42. Adding Graphics to HTML 42 To have a graphic appear on a webpage, web designers must to put the <IMG> tag in with the address where the graphic "lives": <IMG SRC="http://www.someplace.com/images/fish.gif"> Graphics attributes: src:=“pathofimage”. This value will be url/path of the image alt="text": insert a description of the graphic for those who are using browsers that cannot process images (e.g., page readers for the blind) width="xx/xx%": width in pixels/percentage height="xx/xx%": height in pixels/percentage border="xx": pixel length of the border surrounding the image. hspace="xx": places a buffer of space horizontally around the image vspace="xx": places a buffer of space vertically around the image align="top/middle/bottom/right/left": aligns image in relation to the text (see next 2 slides)
  • 43. Anchor Tag Attributes… 43 Title title is very useful because it can be used to indicate some information about the link's destination. <a href="staff/index.html" title="Resumes and information about our staff"> Staff </a> The title attribute serves another purpose: It provides the title information for a bookmark when a link is bookmarked before the destination page is visited. Accelerator Keys With this attribute, you can set a key to invoke an anchor without requiring a pointing device to select the link. The link is activated with the combination of the accelerator key, usually ALT, and the key specified by the attribute. So, <a href="http://www.yahoo.com/" accesskey="Y"> Yahoo! </a> Target the target attribute is left out, the current window or frame the document is in is used. Aside from author-named frames, the following are several reserved names for frames that, when used with the target attribute, have special meaning: _blank, _self, _parent, and _top.
  • 45. Adding Graphics to HTML Contd… 45 <img src="http://www.someplace.com/images/fish.gif" align="top">All about Fish <img src="http://www.someplace.com/images/fish.gif" align="middle">All about Fish <img src="http://www.someplace.com/images/fish.gif" align="bottom">All about Fish All about Fish All about Fish All about Fish
  • 46. Adding Graphics to HTML Contd… 46 <img src="http://www.someplace.com/images/fish.gif" align=“left"> <img src="http://www.someplace.com/images/fish.gif" align=“right">
  • 47. 47 Image and Anchor <a> tags can enclose text and other content, including images. When an anchor encloses an image, the image becomes clickable, thus providing the basic mechanism for a graphic button. <a href="about.html"> <img src="about.gif" alt="About Button" height="55" width="55" /> </a> Image Maps  An image map is a large image that contains numerous hot spots that can be selected, sending the user to a different anchor destination.  Image maps are images, usually in gif format that have been divided into regions; clicking in a region of the image cause the web surfer to be connected to a new URL. Image maps are graphical form of creating links between pages  There are two basic forms of image maps: server-side and client-side.  In the server-side image map, the user clicks on an image but the server must decode where the user clicked before the destination page (if any) is loaded. With client-side image maps, all of the map information—which regions map to which URLs—can be specified in the same HTML file that contains the image.  Including the map data with the image and letting the browser decode it has several advantages, including the following:  There is no need to visit a server to determine the destination, so links are resolved faster.  Destination URLs can be shown in the status box as the user's pointer moves over the image.  Image maps can be created and tested locally, without requiring a server or system administration support.  Client-side image maps can be created so that they present an alternate text menu to users of text-only browsers.
  • 48. <TABLE></TABLE> tag 48  A table is an orderly arrangement of data distributed across a grid of rows and columns. Web page tables also are commonly used to structure a page for layout. In its simplest form, a table places information inside the cells formed by dividing a rectangle into rows and columns. Most cells contain data; some cells, usually on  the table's top or side, contain headings.  HTML represent a basic table using four elements.  table tag pair, <table> … </table>, contains an optional caption element  one or more rows, <tr> … </tr>.  Each row contains cells holding a heading, <th> … </th>, or data, <td> .. </td>.  A table is made up of rows enclosed within <tr> … </tr>. The number of rows in the table is determined by the number of occurrences of the tr element.  The number of columns in a table is determined by the maximum number of data cells in one row indicated by <td> … </td>, or headings indicated by <th> … </th> within the table.  The headings for the table are set using the <th> element. The table might also have a caption enclosed within <caption> … </caption>, whose contents generally are rendered above or below the table, indicating what the table contains.
  • 49. <TABLE></TABLE> tag 49 <table border=“1”> <tr> <th> Column 1 header </th> <th> Column 2 header </th> </tr> <tr> <td> Row1, Col1 </td> <td> Row1, Col2 </td> </tr> <tr> <td> Row2, Col1 </td> <td> Row2, Col2 </td> </tr> </table> Column 1 Header Column 2 Header Row1, Col1 Row1, Col2 Row2, Col1 Row2, Col2
  • 50. <TABLE></TABLE> Attributes 50  BGColor: Some browsers support background colors in a table.  Width: you can specify the table width as an absolute number of pixels or a percentage of the document width. You can set the width for the table cells as well.  Border: You can choose a numerical value for the border width, which specifies the border in pixels.  CellSpacing: Cell Spacing represents the space between cells and is specified in pixels  CellPadding: Cell Padding is the space between the cell border and the cell contents and is specified in pixels.  Align: tables can have left, right, or center alignment.  Background: Background Image, will be titled in IE3.0 and above.  BorderColor, BorderColorDark.
  • 51. Table Caption & Header 51  Table Caption: A table caption allows you to specify a line of text that will appear centered above or bellow the table. <TABLE BORDER=1 CELLPADDING=2> <CAPTION ALIGN=“BOTTOM”> Label For My Table </CAPTION> The Caption element has one attribute ALIGN that can be either TOP (Above the table) or BOTTOM (below the table).  Table Header: Table Data cells are represented by the TD element. Cells can also be TH (Table Header) elements which results in the contents of the table header cells appearing centered and in bold text
  • 52. Table Data & Header Attributes 52  Colspan: Specifies how many cell columns of the table this cell should span.  Rowspan: Specifies how many cell rows of the table this cell should span.  Align: cell data can have left, right, or center alignment.  Valign: cell data can have top, middle, or bottom alignment.  Width: you can specify the width as an absolute number of pixels or a percentage of the document width.  Height: You can specify the height as an absolute number of pixels or a percentage of the document height.
  • 53. Example 53 <TABLE BORDER=1 width=50%> <CAPTION> <h1>Spare Parts <h1> </Caption> <TR><TH>Stock Number</TH><TH>Description</TH><TH>List Price</TH></TR> <TR><TD bgcolor=red>3476-AB</TD><TD>76mm Socket</TD><TD>45.00</TD></TR> <TR><TD >3478-AB</TD><TD><font color=blue>78mm Socket</font> </TD><TD>47.50</TD></TR> <TR><TD>3480-AB</TD><TD>80mm Socket</TD><TD>50.00</TD></TR> </TABLE>
  • 54. Example 54 <Table border=1 cellpadding =2> <tr> <th> Column 1 Header</th> <th> Column 2 Header</th> </tr> <tr> <td colspan=2> Row 1 Col 1</td> </tr> <tr> <td rowspan=2>Row 2 Col 1</td> <td> Row 2 Col2</td> </tr> <tr> <td> Row 3 Col2</td> </tr> </table> Column 1 Header Column 2 Header Row 1 Col 1 Row 2 Col 1 Row 2 Col 2 Row 3 Col 2
  • 55. Example 55 <TABLE BORDER width=“750”> <TR> <TD colspan=“4” align=“center”>Page Banner</TD></TR> <TR> <TD rowspan=“2” width=“25%”>Nav Links</TD> <TD colspan=“2”>Feature Article</TD> <TD rowspan=“2” width=“25%”>Linked Ads</TD> </TR> <TR><TD width=“25%”>News Column 1 </TD> <TD width=“25%”><News Column 2 </TD></TR> </TABLE>
  • 57. Important Points about Table 57 ● TH, TD and TR should always have end tags. Although the end tags are formally optional, many browsers will mess up the formatting of the table if you omit the end tags. In particular, you should always use end tags if you have a TABLE within a TABLE -- in this situation, the table parser gets hopelessly confused if you don't close your TH, TD and TR elements. ● A default TABLE has no borders By default, tables are drawn without border lines. You need the BORDER attribute to draw the lines. ● By default, a table is flush with the left margin TABLEs are plopped over on the left margin. If you want centered tables, You can either: place the table inside a DIV element with attribute ALIGN="center". Most current browsers also supports table alignment, using the ALIGN attribute. Allowed values are "left", "right", or "center", for example: <TABLE ALIGN="left">. The values "left" and "right" float the table to the left or right of the page, with text flow allowed around the table. This is entirely equivalent to IMG alignment
  • 58. Frame in HTML 58 ● A framed document divides a browser window into multiple panes, or smaller window frames. Each frame can contain a different document. ● The benefits of this approach are obvious: users can view information in one frame while keeping another frame open for reference instead of moving back and forth between pages. The contents of one frame can be manipulated, or linked, to the contents of another. ● A frame is an independent scrolling region, or window, of a Web page. Every Web page can be divided into many individual frames, which can even be nested within other frames. ● Of course, fixed screen sizes limit how many frames can realistically be used simultaneously. Each frame in a window can be separated from the others with a border. ● Individual frames usually are named so that they can be referenced through links or scripting, allowing the contents of one frame to affect the contents of another. This referencing capability is a major difference between tables and frames. Frames provide layout facilities and, potentially, navigation
  • 59. Frame in HTML 59  Within the framing document, the frameset element defines the set of frames that makes up the document. The major attributes of this element are:  Rows: <frameset rows="10%, 80%, 10%">  Cols: <frameset cols="20%, 80%">  Use the wildcard character (*) to specify that whatever is left over after 175 pixels should be used for the other frame. The code for such a frameset is  <frameset cols="175,*">.  Within the frameset element, individual <frame> tags are used to specify the documents that are placed within the rows or columns defined by the frameset element.  The basic syntax of the <frame> tag is  <frame src="URL" name="unique frame name" id="unique frame name">.  e.g <frameset rows="30%,30%,40%"> <frame src="header.html" name="header" > <frame src="display.html" name="display" > <frame src="footer.html" name="footer" > </frameset>
  • 60. Frame in HTML 60  For Example to make a framed page with a windowpane on the left and one on the right requires three HTML pages. Doc1.html and Doc2.html are the pages that contain content. Frames.html is the page that describes the division of the single browser window into two windowpanes.
  • 61. Frame-Page Architecture 61  A <FRAMESET> element is placed in the html document before the <BODY> element. The <FRAMESET> describes the amount of screen real estate given to each windowpane by dividing the screen into ROWS or COLS.  The <FRAMESET> will then contain <FRAME> elements, one per division of the browser window. Note: Because there is no BODY container, FRAMESET pages can't have background images and background colors associated with them <HTML> <HEAD> <TITLE> Framed Page </TITLE> <FRAMESET COLS=“23%,77%”> <FRAME SRC=“Doc1.html”> <FRAME SRC=“Doc2.html”> </FRAMESET > </HEAD> </HTML>
  • 62. Frame-Page Architecture 62 frameborder The default value of 1 indicates a frame border should be used while a value of 0 indicates to remove it. So <frame src="links.html" name="controls" id="controls“ frameborder="0"> would turn off borders for this particular frame. Framespacing (frameset) Internet Explorer has added a proprietary attribute, framespacing, to the frameset element to alleviate this. Just set it to 0 and any gaps should be removed under this browser. Scrolling To set scrolling on a frame, use the scrolling attribute on a <frame> tag; by default, the value of this attribute is auto, which adds scrollbars as needed. However, setting the value to yes or no will explicitly indicate the presence or lack of scrollbars regardless of the content within the frame. Noresize The presence of the noresize attribute indicates that the user cannot resize a frame. marginheight and marginwidth These attributes are used to control the distance between the frame and its contents. Very often designers will set these values to 0 to achieve the effect of bleeding framed content right to the edge of the frame. <frame src="blue.html" name="right" id="right" marginwidth="0" marginheight="0“ > The Use of <noframes> The <noframes> tag should contain the markup and text to be displayed when a browser that doesn't support frames accesses the Web page. The <noframes> tag should be found only within the frameset element.
  • 63. 63 Example of frameset <frameset cols="20%, 80%"> <frame src="links.html" name="links" id="links”> <frame src="display.html" name="display" id="display”> <noframes> <body> <p>This document uses frames. Please follow this link to a <a href="noframes.html">no frames</a> version. </p> </body> </noframes> </frameset>
  • 64. 64 The problems with frames are numerous, and include problems with design, navigation, bookmarking, URL context, search engine compatibility, and printing. ● Navigation problems include loss of context because the URL of the document, as displayed in the address bar of the browser, does not change when using frames; this accounts for why bookmarking doesn't work as expected because a bookmark just records a document's URL. ● If they try to bookmark the page, their bookmark will open the frameset with its original pages loaded (frameset home page), not the one you had loaded inside when you created the bookmark. ● Browser Problem :For years there were a considerable amount of browsers in use that could not access framed pages, and were restricted to viewing whatever the author had placed in the <noframes> section of their code. ● Printing Problems : Browsers have had a long-standing problem with printing framed pages. Often you would get only one of the component pages printed off, or have everything scrunched together in a mess. The most recent browsers have given you options on whether you want the full frameset printed or an individual page, but that doesn’t escape the fact that printing framed pages is unnecessarily tricky and problematic. ● Viewing the source code of a page is also made redundant since the frameset code appears where many inexperienced users would expect a large amount of useful code. You can click inside a frame and extract the code from it, but the fact remains, it goes against user’s expectations. Frameset Limitations
  • 65. 65  Another form of frame, known as a floating frame but more appropriately called an inline frame, was initially introduced by Microsoft but has been incorporated into the HTML standards.  The idea of the floating frame is to create an inline framed region, or window, that acts similarly to any other embedded object, insofar as text can be flowed around it.  An inline frame is defined by the <iframe>…</iframe> element and can occur anywhere within the <body> of an HTML document.  Compare this to the frame element that should occur only within the frameset element. Attributes of <iframe> ● Src :The src is set to the URL of the file to load, ● height & width: height and width are set either to the pixel or percentage value of the screen that the floating frame region should consume. ● Align: For basic positioning within the flow of text. ● marginheight and marginwidth: Control the margins on framed content. ● Internet Explorer supports the addition of the hspace and vspace attributes as well. although the HTML and XHTML specification does not. Floating Frame (Inline Frame) <iframe></iframe>
  • 66. 66 <html > <body> <h1 align="center">Floating Frame Example</h1> <iframe src="file1.html" name="iframe1“ width="350" height="200" align="left"> There would be a floating frame here if your browser supported it. </iframe> <p>This is a simple example of how floating frames are used. Notice that in many ways the floating frame acts very similar to an inline image. Floating frames act like embedded objects in many ways. </p> </body> </html> Example of <iframe>