SlideShare une entreprise Scribd logo
1  sur  201
HTML
FaaDoOEngineers.com
2
Part 1
FaaDoOEngineers.com
3
Objectives
• Getting Started With HTML
 Introducing HTML
 How Web pages work
 Introduction to Tags
 Structure of HTML page
• Creating a Web Page
 Introduction table, tr, td tags.
 Paragraphs and Line breaks
 Headings
 Creating Ordered and Unordered List
• Text Formatting And Alignment
 Boldfaces and Italics
 Font Size, Color and Typeface
 Special Characters
FaaDoOEngineers.com
4
• Using Links & Images
• Style Sheet
Purpose of Style Sheet
Style Rules
Attaching Style Sheet
Defining classes
Div tag, Span Tag
Using Span
• Developing Forms
Introducing Forms
 Using Standard Form Controls
Objectives
FaaDoOEngineers.com
5
What is World Wide Web?
• The World Wide Web (Web) is a network of information
resources. The Web relies on three mechanisms to make these
resources readily available to the widest possible audience:
A uniform naming scheme for locating resources on the Web
(e.g., URIs).
Protocols, for access to named resources over the Web (e.g.,
HTTP).
Hypertext, for easy navigation among resources (e.g., HTML).
FaaDoOEngineers.com
6
Introducing HTML
To publish information for global distribution, one
needs a universally understood language, a kind of
publishing mother tongue that all computers may
potentially understand. The publishing language used
by the World Wide Web is HTML (from HyperText
Markup Language).
What is HTML
FaaDoOEngineers.com
7
Introducing HTML
HTML contains special markers, or tags, which define
the style and structure of the page.
Tags are
also referred
to as
elements.
What is HTML
FaaDoOEngineers.com
8
• Publish online documents with headings, texts, tables, lists,
photos, etc.
• Retrieve online information via hypertexts links.
• Design forms for conducting transactions with remote services,
for use in searching for information, making reservations,
ordering products, etc.
• Include spread-sheets, video clips, sound clips, and other
applications directly in their documents.
Introducing HTML
Uses of HTML
FaaDoOEngineers.com
9
How To Access An Web Page
Click To
Proceed With
The Steps
FaaDoOEngineers.com
10
Double Click
on the
Internet
Explorer
button
FaaDoOEngineers.com
11
Browser
Window
Opens
FaaDoOEngineers.com
12
Type the url
address &
Press Enter
Key
http://www.google.com
FaaDoOEngineers.com
13
HTML files
Web Server
Internet
Request
Request
User makes a request
www.google.com
http://www.google.com
FaaDoOEngineers.com
14
HTML files
Web Server
Internet
Web Page
Web Page
Google page is returned from the Web Server
FaaDoOEngineers.com
15 FaaDoOEngineers.com
16
Introducing HTML
A tag is a reference in an HTML document which
describes the style and structure of the document.
All tag start with < (less than symbol) and end with
> (greater than symbol)
Tags which mark a beginning have no / (front slash).
Tags which mark an ending have a / immediately after <,
as in </.
What is a Tag
FaaDoOEngineers.com
17
Introducing HTML
Example on Tag
<HTML>, <BODY>, <TITLE>
</HTML>, </BODY>, </TITLE>
Sample Tags
Starting tags / elements
Ending tags / elements
FaaDoOEngineers.com
18
Introducing HTML
Explanation of the HTML code
<HTML>
<HEAD>
<TITLE> My Home Page </TITLE>
</HEAD>
<!-- Written by Manas K Sahoo -->
<!-- Created: 30-May-2007 -->
<!-- Organization: IBM -->
<BODY>This is where the text goes.
</BODY>
</HTML>
FaaDoOEngineers.com
19
Introducing HTML
Explanation of the HTML code
<HTML>
<HEAD>
<TITLE> My Home Page </TITLE>
</HEAD>
<!-- Written by Manas K Sahoo -->
<!-- Created: 30-May-2007 -->
<!-- Organization: IBM -->
<BODY>This is where the text goes.
</BODY>
</HTML>
Start of an HTML document.
FaaDoOEngineers.com
20
Introducing HTML
Explanation of the HTML code
<HTML>
<HEAD>
<TITLE> My Home Page </TITLE>
</HEAD>
<!-- Written by Manas K Sahoo -->
<!-- Created: 30-May-2007 -->
<!-- Organization: IBM -->
<BODY>This is where the text goes.
</BODY>
</HTML>
Indicates to the browser that this is an HTML
document.
FaaDoOEngineers.com
21
Introducing HTML
Explanation of the HTML code
<HTML>
<HEAD>
<TITLE> My Home Page </TITLE>
</HEAD>
<!-- Written by Manas K Sahoo -->
<!-- Created: 30-May-2007 -->
<!-- Organization: IBM -->
<BODY>This is where the text goes.
</BODY>
</HTML>
HTML document is divided into two sections.
1. <HEAD> …. </HEAD>
FaaDoOEngineers.com
22
Introducing HTML
Explanation of the HTML code
<HTML>
<HEAD>
<TITLE> My Home Page </TITLE>
</HEAD>
<!-- Written by Manas K Sahoo -->
<!-- Created: 30-May-2007 -->
<!-- Organization: IBM -->
<BODY>This is where the text goes.
</BODY>
</HTML>
HTML document is divided into two sections.
2. <BODY> …. </BODY>
FaaDoOEngineers.com
23
Introducing HTML
Explanation of the HTML code
<HTML>
<HEAD>
<TITLE> My Home Page </TITLE>
</HEAD>
<!-- Written by Manas K Sahoo -->
<!-- Created: 30-May-2007 -->
<!-- Organization: IBM -->
<BODY>This is where the text goes.
</BODY>
</HTML>
Shows the contents in the browser title bar.
Generally placed inside Head tag.
FaaDoOEngineers.com
24
Introducing HTML
Explanation of the HTML code
<HTML>
<HEAD>
<TITLE> My Home Page </TITLE>
</HEAD>
<!-- Written by Manas K Sahoo -->
<!-- Created: 30-May-2007 -->
<!-- Organization: IBM -->
<BODY>This is where the text goes.
</BODY>
</HTML>
Indicates comment tag. Can be placed anywhere
in the document.
FaaDoOEngineers.com
25
Introducing HTML
Explanation of the HTML code
<HTML>
<HEAD>
<TITLE> My Home Page </TITLE>
</HEAD>
<!-- Written by Manas K Sahoo -->
<!-- Created: 30-May-2007 -->
<!-- Organization: IBM -->
<BODY>This is where the text goes.
</BODY>
</HTML>
Signal the end of HTML document.
FaaDoOEngineers.com
26
Introducing HTML
1. Range / Container tags
2. Standalone / Point tags
Kinds of Tags
They are called so because they cover a range of text.
Example : <HTML>, <HEAD>, <BODY>, <TITLE>
Those tags which do not need an ending.
Example: <HR>, <BR>
FaaDoOEngineers.com
27
Paragraphs
&
Line Breaks
FaaDoOEngineers.com
28
Line Separators
• Tags used for separating one line with other can be classifies as
follows:-
1. <P> tag
2. <BR> tag
3. <HR> tag
FaaDoOEngineers.com
29
The <P> Tag
• Normally all text in an HTML document is treated like one long
paragraph. Indented or blank lines which normally indicate start
of paragraphs in text are ignored.
• To separate your text into paragraphs use the
• The <P> tag forces an end of line and forces a blank line before
the next paragraph.
<P> tag.
FaaDoOEngineers.com
30
Requirement Analysis
FaaDoOEngineers.com
31
<p>This is should be the end of my first
paragraph in HTML.</p>
<p>This should be the start of my second paragraph in
HTML.</p>
<p>And this is should be my third paragraph in
HTML.</p>
Code Snippet To Fulfill the Requirement
FaaDoOEngineers.com
32
<p>This is should be the end of my first
paragraph in HTML.</p>
<p>This should be the start of my second paragraph in
HTML.</p>
<p>And this is should be my third paragraph in
HTML.</p>
<p> tag forces an end of line and forces a blank line before the next paragraph.
FaaDoOEngineers.com
33
<p>This is should be the end of my first
paragraph in HTML.</p>
<p>This should be the start of my second paragraph in
HTML.</p>
<p>And this is should be my third paragraph in
HTML.</p>
<p> tag forces an end of line and forces a blank line before the next paragraph.
Ends the paragraph tag.
FaaDoOEngineers.com
34
The <BR> Tag
• Used to control the line breaks.
• Use single spacing among the lines unlike <p> tag that uses
double spacing among the paragraph.
• Does not have a closing braces.
FaaDoOEngineers.com
35
Requirement Analysis
FaaDoOEngineers.com
36
This is should be the end of my first
paragraph in HTML.<br>
This should be the start of my second paragraph in
HTML.<br>
<p>And this is should be my third paragraph in
HTML.<br>
Code Snippet To Fulfill the Requirement
FaaDoOEngineers.com
37
This is should be the end of my first
paragraph in HTML.<br>
This should be the start of my second paragraph in
HTML.<br>
<p>And this is should be my third paragraph in
HTML.<br>
Forces line break with one line spacing between two lines.
FaaDoOEngineers.com
38
The <HR> tag
• The <HR> tag draws a horizontal line across the page.
• It acts a paragraph break.
• There is no need to use the <BR> before or after the <HR> tag.
FaaDoOEngineers.com
39
Requirement Analysis
FaaDoOEngineers.com
40
This is should be the end of my first
paragraph in HTML.<hr>
This should be the start of my second paragraph in
HTML.<hr>
And this is should be my third paragraph in
HTML.<hr>
Code Snippet To Fulfill the Requirement
FaaDoOEngineers.com
41
This is should be the end of my first
paragraph in HTML.<hr>
This should be the start of my second paragraph in
HTML.<hr>
And this is should be my third paragraph in
HTML.<hr>
Draws a horizontal line across the page.
FaaDoOEngineers.com
42
<HR> tag Attributes
<hr color=“red”>
1. Color Attribute
How To
Use
<hr color=“blue”>
<hr color=“pink”>
FaaDoOEngineers.com
43
<HR> tag Attributes
<hr width=“50%”>
2. Width Attribute
How To
Use
<hr color=“blue” width=“100%”>
<hr width=“500”>
Default alignment
of HR is center.
FaaDoOEngineers.com
44
<HR> tag Attributes
<hr align=“left” width=“50%”>
3. Align Attribute
How To
Use
<hr align=“right” width=“50%”>
<hr align=“center”
width=“50%”>
FaaDoOEngineers.com
45
<HR> tag Attributes
<hr size=“5”>
4. Size Attribute
How To
Use
<hr size=“3” color=“red”>
<hr align=“center” width=“50%”
size=“2”>
FaaDoOEngineers.com
46
The Headings Tags
• To add headings in the HTML document use tag
where, n represent number from 1 to 6.
<Hn>
<H1> </H1>Some text here
<H2> </H2>
<H3> </H3>
<H4> </H4>
<H5> </H5>
<H6> </H6>
Some text here
Some text here
Some text here
Some text here
Some text here
FaaDoOEngineers.com
47
Listing In HTML
• A common applications of HTML is to display the list of items.
• The most popular types of lists that can be created using HTML
are:
 Unordered List
 Ordered List
FaaDoOEngineers.com
48
Unordered List
• When the list of contents that you want to display don‟t have to follow
any sequence then you can use Unordered list.
• Each item in the unordered list is indented.
For Example, while creating list of Electronic products, where sequence
of occurrence does not matter.
<UL>
tag is used to create a Unordered list.
FaaDoOEngineers.com
49
Unordered List
• When the list of contents that you want to display don‟t have to follow
any sequence then you can use Unordered list.
• Each item in the unordered list is indented.
For Example, while creating list of Electronic products, where sequence
of occurrence does not matter.
<LI>
tag identifies a item in the list.
FaaDoOEngineers.com
50
Unordered List
<HTML>
<BODY>
<H3>List of Electronic Products</H3>
<UL>
<LI>T.V.</LI>
<LI>VCD</LI>
<LI>DVD</LI>
<LI>REFRIGERATOR</LI>
<LI>WASHING MACHINE</LI>
<LI>MICRO OVEN</LI>
</UL>
</BODY>
</HTML>
Check Out An
Example
FaaDoOEngineers.com
51
Check Out The
Output
FaaDoOEngineers.com
52
Ordered List
• When the list of contents that you want to display have to follow a
sequence.
• Each item in the ordered list is indented.
• For Example, creating a list of students based on their merit.
<OL>
tag is used to create a Ordered list.
FaaDoOEngineers.com
53
Ordered List
<HTML>
<BODY>
<H3>List of Fortune 500 Companies – Industry: Computers, Office
Equipment Year 2006 Survey </H3>
<OL>
<LI>IBM</LI>
<LI>HP</LI>
<LI>Dell</LI>
<LI>NEC</LI>
<LI>Fujitsu</LI>
<LI>Canon</LI>
</OL>
</BODY>
</HTML>
Check Out An
Example
FaaDoOEngineers.com
54
Check Out The
Output
FaaDoOEngineers.com
55
Text Formatting and
Alignment
FaaDoOEngineers.com
56
1. <PRE> tag
Character Styles
2. <BLOCKQUOTE> tag
3. <ADDRESS> tag
4. Logical Character Highlighting tags
5. Physical Character Highlighting tags
Text Formatting
FaaDoOEngineers.com
57
1. <PRE> tag
Character Styles
• It is used to include preformatted text into your HTML
document.
• Text will appeared exactly as typed including, tabs and
returns.
Text Formatting (Contd.)
FaaDoOEngineers.com
58
1. <PRE> tag
Character Styles
<pre>
This is should be the end of my first paragraph in HTML.
This should be the start of my second
paragraph in HTML.</pre>
And this is should be my third paragraph in HTML.
Sample Code
Text Formatting (Contd.)
FaaDoOEngineers.com
59
1. <PRE> tag
Character Styles
Sample Output
Text Formatting (Contd.)
FaaDoOEngineers.com
60
2. <BLOCKQUOTE> tag
Character Styles
• Used to include indented text in a document.
• Both the right and left margin are indented.
Text Formatting (Contd.)
FaaDoOEngineers.com
61
2. <BLOCKQUOTE> tag
Character Styles
Most Popular Quote of Shakespeare :
<BLOCKQUOTE>
To Be, Or Not To Be: That Is The Question
</BLOCKQUOTE>
Sample Code
Text Formatting (Contd.)
FaaDoOEngineers.com
62
2. <BLOCKQUOTE> tag
Character Styles
Sample Output
Text Formatting (Contd.)
FaaDoOEngineers.com
63
3. <ADDRESS> tag
Character Styles
• It defines text that gives an address or other contact
information.
• It is displayed in italic.
• Generally, displayed in the bottom of the page.
Text Formatting (Contd.)
FaaDoOEngineers.com
64
3. <ADDRESS> tag
Character Styles
IBM stands for International Business Machines.
<hr color=“blue”>
The HeadQuarter is located at:
<ADDRESS>
IBM Armonk, <BR>New York, USA.
</ADDRESS>
Sample Code
Text Formatting (Contd.)
FaaDoOEngineers.com
65
3. <ADDRESS> tag
Character Styles
Sample Output
Text Formatting (Contd.)
FaaDoOEngineers.com
66
4.
Character Styles
• Logical Character Highlighters are also known as
Idiomatic styles tags.
• The purpose of logical tags is to convey the basic
semantic meaning of a piece of text rather than the
absolute appearance.
• It is used to give your text a different look when displayed
by browsers.
• Browser handle the look and feel of the logical tag.
Logical Character Highlighting tags
Text Formatting (Contd.)
FaaDoOEngineers.com
67
4.
Character Styles
Logical Character Highlighting tags
Name Tag Example
Strong <STRONG> This is STRONG text
Emphasis <EM> This is EMphasized text
Code <CODE> This is CODEd text
Keyboard <KBD> This is “KeyBoarD” text
Variable <VAR> This is VARiable text
Text Formatting (Contd.)
FaaDoOEngineers.com
68
5.
Character Styles
• Physical Character Highlighters are also known as
Typographical styles tags.
• It is used to give your text a different look but exacting
look.
• Not all browsers support physical styles.
Physical Character Highlighting tags
Text Formatting (Contd.)
FaaDoOEngineers.com
69
5.
Character Styles
Physical Character Highlighting tags
Name Tag Example
Bold <B> This is Bold text
Italics <I> This is Italicized text
Underline <U> This is a underlined text
Teletype <TT> This is TeleType text
Superscript <SUP> X2Y3
Subscript <SUB> H2SO4
Text Formatting (Contd.)
FaaDoOEngineers.com
70
Font Tag
• It is used to change the font color, fontsize,
fontfaceof text in an HTML document.
Text Formatting (Contd.)
FaaDoOEngineers.com
71
1. Size
Attributes of Font Tag
2. Color
3. Face
Text Formatting (Contd.)
FaaDoOEngineers.com
72
1. Size
Attributes of Font Tag
Default font size is 3.
Largest font size can be set is 7.
Smallest is 1.
The primary <FONT> attribute is SIZE=x, where x is an
absolute value ranging from 1 to 7 or a relative vale (+/-).
Text Formatting (Contd.)
FaaDoOEngineers.com
73
1. Size
Attributes of Font Tag
Html Code Output
<FONT SIZE=4>HTML is Fun</FONT> HTML is Fun
<FONT SIZE=+1>HTML is Fun</FONT> HTML is Fun
<FONT SIZE=1>HTML is Fun</FONT> HTML is Fun
<FONT SIZE=-2>HTML is Fun</FONT> HTML is Fun
Text Formatting (Contd.)
FaaDoOEngineers.com
74
2. Color
Attributes of Font Tag
There are 3 different methods to set color.
i. Generic Coloring System
ii. RGB Coloring System
iii. Hexadecimal Coloring System
Text Formatting (Contd.)
FaaDoOEngineers.com
75
2. Color
Attributes of Font Tag
i. Generic Coloring System
Generics colors are preset HTML coded colors where the
value is simply the name of each color.
Text Formatting (Contd.)
FaaDoOEngineers.com
76
2. Color
Attributes of Font Tag
i. Generic Coloring System
Black Gray Silver White
Yellow Lime Aqua Fuchsia
Red Green Blue Purple
Maroon Olive Navy Teal
Sample
Generic
Basic Colors
Text Formatting (Contd.)
FaaDoOEngineers.com
77
2. Color
Attributes of Font Tag
ii. RGB Coloring System
RGB stands for Red, Green, Blue. Each can have a value
from 0 (none of that color) to 255 (fully that color).
The format for RGB is – RGB (Red, Green, Blue)
Text Formatting (Contd.)
FaaDoOEngineers.com
78
2. Color
Attributes of Font Tag
ii. RGB Coloring System
<font color=RGB(255,0,0)>Confidence</font> Confidence
<font color=RGB(255,255,0)>Confidence</font> Confidence
<font color=RGB(0,0,255)>Confidence</font> Confidence
<font color=RGB(255,255,255)>Confidence</font> Confidence
OutputExample
Text Formatting (Contd.)
FaaDoOEngineers.com
79
2. Color
Attributes of Font Tag
iii. Hexadecimal Coloring System
A hexadecimal is a 6 digit representation of a color.
XX XX XX
Red Green Blue
Text Formatting (Contd.)
FaaDoOEngineers.com
80
2. Color
Attributes of Font Tag
iii. Hexadecimal Coloring System
<font color=“#FF0000”>Confidence</font> Confidence
<font color=“#FFFF00”>Confidence</font> Confidence
<font color=“#0000FF”>Confidence</font> Confidence
<font color=“#FFFFFF”>Confidence</font> Confidence
Example Output
Text Formatting (Contd.)
FaaDoOEngineers.com
81
Color
Color
Name
Hexadecimal
Value
Color
Color
Name
Hexadecimal
Value
Black #000000 Green #008000
Silver #c0c0c0 Lime #00ff00
Gray #808080 Olive #808000
White #ffffff Yellow #ffff00
Maroon #800000 Navy #000080
Red #ff0000 Blue #0000ff
Purple #800080 Teal #008080
Fushia #ff00ff Aqua #00ffff
Text Formatting (Contd.)
FaaDoOEngineers.com
82
3. Face
Attributes of Font Tag
The font face attribute is used to specify the font name.
Text Formatting (Contd.)
FaaDoOEngineers.com
83
3.
Attributes of Font Tag
<font face=“Serif”>Confidence</font> Confidence
<font face=“Courier”>Confidence</font> Confidence
<font face=“Palatino”>Confidence</font> Confidence
<font face=“Monotype Corsiva”>Confidence</font> Confidence
Output
Example
Face
Code
Snippet
Text Formatting (Contd.)
FaaDoOEngineers.com
84
Special Characters
<html>
<body>
<h2><b>&lt;MARQUEE&gt;</b> is used to scroll the
enclosing text.</h2>
</body>
</html>
Exampl
e
Text Formatting (Contd.)
FaaDoOEngineers.com
85
Special Characters
Output
Text Formatting (Contd.)
FaaDoOEngineers.com
86
Using Links
&
Images
FaaDoOEngineers.com
FaaDoO
87
Using Links
• The Anchor Tag
 HTML uses the <a> (anchor) tag to create a link to another document.
 Attributes of <a>(anchor) tag
• href : is used to address the document to link to, and the
words between the open and close of the anchor tag will be
displayed as a hyperlink.
Syntax:
<a href=”url”>Text to be displayed</a>
FaaDoOEngineers.com
88
Using Links (Contd.)
Attributes of <a>(anchor) tag
• target : The target attribute defines where the linked
document will be opened.
Syntax:
<a href=“http://w3.ibm.com” target=“where to place the
document”>Text to be displayed</a>
• name :The name attribute is used to create a named
anchor. When using named anchors we can create links
that can jump directly into a specific section on a page.
Syntax
<a name=“label”>Text to be displayed</a>
FaaDoOEngineers.com
89
Example of a Hyperlink
<html>
<head>
<title>Example of a
Hyperlink</title>
<head>
<body>
<a href=“http://w3.IBM.com”>
IBM</a>
<a href=“http://w3.IBM.com”
target=“_blank”>IBM</a>
---- other information within body
tag-------
</body>
</html>
The word IBM will be highlighted , and
on clicking IBM the user will be taken to
the w3 pages of IBM, the page will be
opened on the same window
The word IBM will be highlighted , and
on clicking IBM the user will be taken to
the w3 pages of IBM, the page will be
opened on a new window.
FaaDoOEngineers.com
90
Example of Naming a link and accessing it
<html>
<body>
<a name=“locations”>
locations</a>
Kolkata, Bangalore, Hyd, Pune,
Chandigarh, Gurgoan
----- other information
----------
<a href=“#locations”>IBM
Location In India</a>
</body>
</html>
On Clicking on IBM Location in India you
will be linked to the section which has
been named as locations
FaaDoOEngineers.com
91
Embedding Images
• The image tag
In Html images are defined by using the <img> tag
The <img> tag is a open tag ( does not have a </img>)
Attributes of <img> tag
• src : To display an image on a page, you need to use the
src attribute . The value of the src is the url of the image to
be displayed
• Syntax
<img src=“url”>
FaaDoOEngineers.com
92
Embedding images ( contd.)
Attributes of <img> tag
• alt :The alt attribute is used to define an "alternate text" for
an image. The value of the alt attribute is an author-defined
text:
• Syntax
<img src=“url” alt=“user defined text”>
• width & height : the size of the image can be controlled by
using the width and height attributes
• Syntax
<img src=“url” width=“size in pixels” height=“size in pixels”>
FaaDoOEngineers.com
93
Embedding images(contd.)
Attributes of <img> tag
• align : An image can be aligned with the surrounding text
by using the align attribute
• Syntax
<img src=“url” width=“value in pixels” height=“value in pixels”
align=“positon, ie left,right,top bottom…” >
• Images can be used as hyperlinks also.
<a href=“http://w3.ibm.com”> <img src=“logo.gif” width=“30
height=“40” ></a>
FaaDoOEngineers.com
94
Example of an embedded image
<html>
<body>
<p>
An image
<img src=“home.gif"
align="bottom" width="48" height="48">
in the text
</p>
<p>
An image
<img src ="home.gif"
align="middle" width="48" height="48">
in the text
</p> </body> </html>
FaaDoOEngineers.com
95
HTML Table
• Table allows to organize and present data in an orderly and
concise manner.
• Tabular structures were introduced with HTML 3.2.
• A table can contains wide variety of information, such as headers,
anchors, lists, paragraphs, forms, images, preformatted text and
even nested tables.
• HTML tables are composed of rows and columns.
FaaDoOEngineers.com
96
Requirement Analysis
FaaDoOEngineers.com
97
<html>
<body>
<table border=“1”>
<caption>IBM Strategic Business Unit</caption>
<tr>
<th>Unit Name</th>
<th>Description</th>
</tr>
<tr>
<td>BCS</td>
<td>Business Consultancy Services</td>
</tr>
<tr>
<td>SWG</td>
<td>Software Group</td>
</tr>
</table>
</body>
</html>
Code Snippet To Fulfill the Requirement
FaaDoOEngineers.com
98
<html>
<body>
<table border=“1”>
<caption>IBM Strategic Business Unit</caption>
<tr>
<th>Unit Name</th>
<th>Description</th>
</tr>
<tr>
<td>BCS</td>
<td>Business Consultancy Services</td>
</tr>
<tr>
<td>SWG</td>
<td>Software Group</td>
</tr>
</table>
</body>
</html>
For starting a table
FaaDoOEngineers.com
99
<html>
<body>
<table border=“1”>
<caption>IBM Strategic Business Unit</caption>
<tr>
<th>Unit Name</th>
<th>Description</th>
</tr>
<tr>
<td>BCS</td>
<td>Business Consultancy Services</td>
</tr>
<tr>
<td>SWG</td>
<td>Software Group</td>
</tr>
</table>
</body>
</html>
It is an attribute of table tag to specify the thickness of the border of the table in
pixels.
FaaDoOEngineers.com
100
Table Border set to 1
FaaDoOEngineers.com
101
If Table Border set to 5
FaaDoOEngineers.com
102
<html>
<body>
<table border=“1”>
<caption>IBM Strategic Business Unit</caption>
<tr>
<th>Unit Name</th>
<th>Description</th>
</tr>
<tr>
<td>BCS</td>
<td>Business Consultancy Services</td>
</tr>
<tr>
<td>SWG</td>
<td>Software Group</td>
</tr>
</table>
</body>
</html>
For starting a table
For ending a table
FaaDoOEngineers.com
103
<html>
<body>
<table border=“1”>
<caption>IBM Strategic Business Unit</caption>
<tr>
<th>Unit Name</th>
<th>Description</th>
</tr>
<tr>
<td>BCS</td>
<td>Business Consultancy Services</td>
</tr>
<tr>
<td>SWG</td>
<td>Software Group</td>
</tr>
</table>
</body>
</html>
For starting a table caption, It is like a title which resides outside the border of
the table. It is an optional attribute.
FaaDoOEngineers.com
104
<html>
<body>
<table border=“1”>
<caption>IBM Strategic Business Unit</caption>
<tr>
<th>Unit Name</th>
<th>Description</th>
</tr>
<tr>
<td>BCS</td>
<td>Business Consultancy Services</td>
</tr>
<tr>
<td>SWG</td>
<td>Software Group</td>
</tr>
</table>
</body>
</html>
For ending a table caption
For starting a table caption, It is like a title which resides outside the border of
the table. It is an optional attribute.
FaaDoOEngineers.com
105
Table Caption
FaaDoOEngineers.com
106
<html>
<body>
<table border=“1”>
<caption>IBM Strategic Business Unit</caption>
<tr>
<th>Unit Name</th>
<th>Description</th>
</tr>
<tr>
<td>BCS</td>
<td>Business Consultancy Services</td>
</tr>
<tr>
<td>SWG</td>
<td>Software Group</td>
</tr>
</table>
</body>
</html>
For starting a table row
FaaDoOEngineers.com
107
<html>
<body>
<table border=“1”>
<caption>IBM Strategic Business Unit</caption>
<tr>
<th>Unit Name</th>
<th>Description</th>
</tr>
<tr>
<td>BCS</td>
<td>Business Consultancy Services</td>
</tr>
<tr>
<td>SWG</td>
<td>Software Group</td>
</tr>
</table>
</body>
</html>
For starting a table row
For ending a table row.
FaaDoOEngineers.com
108
Row 1
Row 2
FaaDoOEngineers.com
109
<html>
<body>
<table border=“1”>
<caption>IBM Strategic Business Unit</caption>
<tr>
<th>Unit Name</th>
<th>Description</th>
</tr>
<tr>
<td>BCS</td>
<td>Business Consultancy Services</td>
</tr>
<tr>
<td>SWG</td>
<td>Software Group</td>
</tr>
</table>
</body>
</html>
For providing a table heading. By default the header cell will appear in bolder
type and the default alignment is center.
FaaDoOEngineers.com
110
<html>
<body>
<table border=“1”>
<caption>IBM Strategic Business Unit</caption>
<tr>
<th>Unit Name</th>
<th>Description</th>
</tr>
<tr>
<td>BCS</td>
<td>Business Consultancy Services</td>
</tr>
<tr>
<td>SWG</td>
<td>Software Group</td>
</tr>
</table>
</body>
</html>
For providing a table heading. By default the header cell will appear in bolder
type and the default alignment is center.
For ending a table heading.
FaaDoOEngineers.com
111
Table Heading
FaaDoOEngineers.com
112
<html>
<body>
<table border=“1”>
<caption>IBM Strategic Business Unit</caption>
<tr>
<th>Unit Name</th>
<th>Description</th>
</tr>
<tr>
<td>BCS</td>
<td>Business Consultancy Services</td>
</tr>
<tr>
<td>SWG</td>
<td>Software Group</td>
</tr>
</table>
</body>
</html>
For providing the table data. By default the alignment is left.
FaaDoOEngineers.com
113
<html>
<body>
<table border=“1”>
<caption>IBM Strategic Business Unit</caption>
<tr>
<th>Unit Name</th>
<th>Description</th>
</tr>
<tr>
<td>BCS</td>
<td>Business Consultancy Services</td>
</tr>
<tr>
<td>SWG</td>
<td>Software Group</td>
</tr>
</table>
</body>
</html>
For providing the table data. By default the alignment is left.
For ending a table data tag.
FaaDoOEngineers.com
114
Table Data
FaaDoOEngineers.com
115
Requirement Analysis
FaaDoOEngineers.com
116
<table border="1">
<caption>ROWSPAN Example</caption>
<tr><th>Group Name</th>
<th>SubGroup Name</th>
<th>Group Name</th>
<th>SubGroup Name</th>
</tr>
<TR>
<td ROWSPAN="4"> Group 1</td> <td>1a</td>
<td ROWSPAN="4"> Group 2</td><td>2a</td>
</tr>
<tr>
<td>1b</td>
<td>2b</td>
</tr>
<tr>
<td>1c</td>
<td>2c</td>
</tr>
<tr>
<td>1d</td>
<td>2d</td>
</tr>
</table>
Code Snippet To Fulfill the Requirement
FaaDoOEngineers.com
117
<table border="1">
<caption>ROWSPAN Example</caption>
<tr><th>Group Name</th>
<th>SubGroup Name</th>
<th>Group Name</th>
<th>SubGroup Name</th>
</tr>
<TR>
<td ROWSPAN="4"> Group 1</td> <td>1a</td>
<td ROWSPAN="4"> Group 2</td><td>2a</td>
</tr>
<tr>
<td>1b</td>
<td>2b</td>
</tr>
<tr>
<td>1c</td>
<td>2c</td>
</tr>
<tr>
<td>1d</td>
<td>2d</td>
</tr>
</table>
This attribute is used to span cell more than one row. In this case it will span the
1st column into four rows including the current row.
FaaDoOEngineers.com
118
This cell is spanned to 4 rows
FaaDoOEngineers.com
119
<table border="1">
<caption>ROWSPAN Example</caption>
<tr><th>Group Name</th>
<th>SubGroup Name</th>
<th>Group Name</th>
<th>SubGroup Name</th>
</tr>
<TR>
<td ROWSPAN="4"> Group 1</td> <td>1a</td>
<td ROWSPAN="4"> Group 2</td><td>2a</td>
</tr>
<tr>
<td>1b</td>
<td>2b</td>
</tr>
<tr>
<td>1c</td>
<td>2c</td>
</tr>
<tr>
<td>1d</td>
<td>2d</td>
</tr>
</table>
The 3rd column is spanning more 4 rows including the current row..
FaaDoOEngineers.com
120
This cell is spanned to 4 rows
FaaDoOEngineers.com
121
<table border="1">
<caption>ROWSPAN Example</caption>
Analyzing The Code
FaaDoOEngineers.com
122 FaaDoOEngineers.com
123
<table border="1">
<caption>ROWSPAN Example</caption>
<tr><th>Group Name</th>
<th>SubGroup Name</th>
<th>Group Name</th>
<th>SubGroup Name</th>
</tr>
Analyzing The Code
FaaDoOEngineers.com
124 FaaDoOEngineers.com
125
<table border="1">
<caption>ROWSPAN Example</caption>
<tr><th>Group Name</th>
<th>SubGroup Name</th>
<th>Group Name</th>
<th>SubGroup Name</th>
</tr>
<TR>
<td ROWSPAN="4"> Group 1</td> <td>1a</td>
<td ROWSPAN="4"> Group 2</td><td>2a</td>
</tr>
Analyzing The Code
FaaDoOEngineers.com
126 FaaDoOEngineers.com
127
<table border="1">
<caption>ROWSPAN Example</caption>
<tr><th>Group Name</th>
<th>SubGroup Name</th>
<th>Group Name</th>
<th>SubGroup Name</th>
</tr>
<TR>
<td ROWSPAN="4"> Group 1</td> <td>1a</td>
<td ROWSPAN="4"> Group 2</td><td>2a</td>
</tr>
Analyzing The Code
<tr>
<td>1b</td>
<td>2b</td>
</tr>
FaaDoOEngineers.com
128 FaaDoOEngineers.com
129
<table border="1">
<caption>ROWSPAN Example</caption>
<tr><th>Group Name</th>
<th>SubGroup Name</th>
<th>Group Name</th>
<th>SubGroup Name</th>
</tr>
<TR>
<td ROWSPAN="4"> Group 1</td> <td>1a</td>
<td ROWSPAN="4"> Group 2</td><td>2a</td>
</tr>
Analyzing The Code
<tr>
<td>1b</td>
<td>2b</td>
</tr>
<tr>
<td>1c</td>
<td>2c</td>
</tr>
FaaDoOEngineers.com
130 FaaDoOEngineers.com
131
<table border="1">
<caption>ROWSPAN Example</caption>
<tr><th>Group Name</th>
<th>SubGroup Name</th>
<th>Group Name</th>
<th>SubGroup Name</th>
</tr>
<TR>
<td ROWSPAN="4"> Group 1</td> <td>1a</td>
<td ROWSPAN="4"> Group 2</td><td>2a</td>
</tr>
Analyzing The Code
<tr>
<td>1b</td>
<td>2b</td>
</tr>
<tr>
<td>1c</td>
<td>2c</td>
</tr>
<tr>
<td>1d</td>
<td>2d</td>
</tr>
</table>
FaaDoOEngineers.com
132 FaaDoOEngineers.com
133
RequirementRequirement Analysis
FaaDoOEngineers.com
134
<table border="1">
<caption>COLSPAN Example</caption>
<tr>
<th colspan="5"> Product Description</th>
</tr>
<tr>
<th> Product Code</th>
<th> Product Name</th>
<th colspan="2"> Price</th>
</tr>
<tr>
<td
colspan="2">&nbsp;</td><td>Rs.</td><td>Ps.</td>
</tr>
<tr>
<td>A001</td><td>AAA</td>
<td>150</td><td>00</td>
</tr>
<tr>
<td>B002</td><td>BBB</td>
<td>120</td><td>99</td>
</tr>
<tr>
<td>C002</td><td>CCC</td>
<td>250</td><td>00</td>
</tr>
</table>
Code Snippet To Fulfill the Requirement
FaaDoOEngineers.com
135
<table border="1">
<caption>COLSPAN Example</caption>
<tr>
<th colspan="5"> Product Description</th>
</tr>
<tr>
<th> Product Code</th>
<th> Product Name</th>
<th colspan="2"> Price</th>
</tr>
<tr>
<td
colspan="2">&nbsp;</td><td>Rs.</td><td>Ps.</td>
</tr>
<tr>
<td>A001</td><td>AAA</td>
<td>150</td><td>00</td>
</tr>
<tr>
<td>B002</td><td>BBB</td>
<td>120</td><td>99</td>
</tr>
<tr>
<td>C002</td><td>CCC</td>
<td>250</td><td>00</td>
</tr>
</table>
This attribute is used to span cell more than one column. In this case it will span
the 1st column into five more nested columns.
FaaDoOEngineers.com
136
This cell is spanned to 5 columns
FaaDoOEngineers.com
137
<table border="1">
<caption>COLSPAN Example</caption>
<tr>
<th colspan="5"> Product Description</th>
</tr>
<tr>
<th> Product Code</th>
<th> Product Name</th>
<th colspan="2"> Price</th>
</tr>
<tr>
<td
colspan="2">&nbsp;</td><td>Rs.</td><td>Ps.</td>
</tr>
<tr>
<td>A001</td><td>AAA</td>
<td>150</td><td>00</td>
</tr>
<tr>
<td>B002</td><td>BBB</td>
<td>120</td><td>99</td>
</tr>
<tr>
<td>C002</td><td>CCC</td>
<td>250</td><td>00</td>
</tr>
</table>
It will span the 3rd column into two more nested columns.
FaaDoOEngineers.com
138
This cell is spanned to 2 columns
FaaDoOEngineers.com
139
<table border="1">
<caption>COLSPAN Example</caption>
<tr>
<th colspan="5"> Product Description</th>
</tr>
<tr>
<th> Product Code</th>
<th> Product Name</th>
<th colspan="2"> Price</th>
</tr>
<tr>
<td
colspan="2">&nbsp;</td><td>Rs.</td><td>Ps.</td>
</tr>
<tr>
<td>A001</td><td>AAA</td>
<td>150</td><td>00</td>
</tr>
<tr>
<td>B002</td><td>BBB</td>
<td>120</td><td>99</td>
</tr>
<tr>
<td>C002</td><td>CCC</td>
<td>250</td><td>00</td>
</tr>
</table>
It will span the 3rd row 1st column into two columns. In other words, it will merge
the 1st two columns of the 3rd row.
FaaDoOEngineers.com
140
This cell is spanned to 2 columns
FaaDoOEngineers.com
141
Some More Attributes of Table tag
• Cellspacing - The CELLSPACING attribute creates a space, or
border, of the specified number of pixels, between each cell.
• Cellpadding - The CELLPADDING attribute separates text of the
cell from the cell border with a padding with the specified number
of pixels.
• Width - specify the width of the table
FaaDoOEngineers.com
142
USING CELLSPACING ATTRIBUTE
<html>
<body>
<table cellspacing=“25" border="1">
<tr><th>Table Heading 1</th>
<th>Table Heading 2</th>
</tr>
<tr><td>Table Contents 1</td>
<td>Table Contents 2</td>
</tr>
</body>
</html>
FaaDoOEngineers.com
143
USING CELLSPACING ATTRIBUTE
<html>
<body>
<table cellspacing=“25" border="1">
<tr><th>Table Heading 1</th>
<th>Table Heading 2</th>
</tr>
<tr><td>Table Contents 1</td>
<td>Table Contents 2</td>
</tr>
</body>
</html>
FaaDoOEngineers.com
144
Vertical Cell spacing
Horizontal Cell spacing
FaaDoOEngineers.com
145
USING CELLPADDING ATTRIBUTE
<html>
<body>
<table cellpadding=“25" border="1">
<tr><th>Table Heading 1</th>
<th>Table Heading 2</th>
</tr>
<tr><td>Table Contents 1</td>
<td>Table Contents 2</td>
</tr>
</body>
</html>
FaaDoOEngineers.com
146
USING CELLPADDING ATTRIBUTE
<html>
<body>
<table cellpadding=“25" border="1">
<tr><th>Table Heading 1</th>
<th>Table Heading 2</th>
</tr>
<tr><td>Table Contents 1</td>
<td>Table Contents 2</td>
</tr>
</body>
</html>
FaaDoOEngineers.com
147
Vertical Cell padding
Horizontal Cell padding
FaaDoOEngineers.com
148
USING WIDTH ATTRIBUTE
<html>
<body>
<table width=“80%" border="1">
<tr><th>Table Heading 1</th>
<th>Table Heading 2</th>
</tr>
<tr><td>Table Contents 1</td>
<td>Table Contents 2</td>
</tr>
</body>
</html>
FaaDoOEngineers.com
149
USING WIDTH ATTRIBUTE
<html>
<body>
<table width=“80%" border="1">
<tr><th>Table Heading 1</th>
<th>Table Heading 2</th>
</tr>
<tr><td>Table Contents 1</td>
<td>Table Contents 2</td>
</tr>
</body>
</html>
FaaDoOEngineers.com
150
Cell Width
FaaDoOEngineers.com
151
if Cell Width = 20%
FaaDoOEngineers.com
152
Table Alignment Related Attribute
• HTML tables can be aligned on the page, and cell content can be
aligned within the cell.
This attribute use to align
HORIZONTALLY is
ALIGN
CENTER
LEFT
RIGHT
Attribute
values
are
This attribute use to align
VERTICALLY is
VALIGN
MIDDLE
TOP
BOTTOM
Attribute
values
are
The blinking attribute value is the default value for VALIGN.
FaaDoOEngineers.com
153
VALIGN=“top”
Table Alignment
Cell1 Cell2 Cell3
Cell4 Cell5 Cell6
Cell7 Cell8 Cell9
ALIGN=“left”
VALIGN=“middle”
VALIGN=“bottom”
ALIGN=“center” ALIGN=“right”
FaaDoOEngineers.com
154
Web
StyleSheets
FaaDoOEngineers.com
FaaDoO
155
Cascading Style Sheet
• Web style sheets are a form of separation of presentation and
content for web design .
• Style sheet can decide the presentation of web pages.
• Style sheet takes care of all the layout, fonts, colors and overall
look of the site.
FaaDoOEngineers.com
156
Cascading Style Sheet (contd..)
• Principal means of Styling a document using Cascading style
sheets are:
Inline style Sheet
External style Sheet
Embedded style Sheet
FaaDoOEngineers.com
157
Benefits of a Cascading Style Sheet
• Pages download faster.
• Page contains less code, and the pages are shorter and neater.
• The look of the site is kept consistent throughout all the pages
that work off the same stylesheet.
• Updating the design and general site maintenance are made
much easier.
FaaDoOEngineers.com
158
Parts of a Cascading Style Sheet
• CSS syntax is made up of three parts:
Selector
Property
Value
HTML tag that you wish to change
The attribute that you wish to change
Each property can take a value
FaaDoOEngineers.com
159
Inline Style Sheet
• Inline style sheets are applied by coding style properties and
values inside the tags to which they apply.
• An inline style sheet can appear inside any tag to directly set its
style. All that is required is to enclose the applicable style
properties and values inside a quoted style attribute.
• Syntax
<tag style=“property:value [;property:value]…”>
FaaDoOEngineers.com
160
Inline Style Sheet(contd.)
<html>
<body>
<pre>
<h1> Inline Style Sheet</h1>
<p style="font-size: 12pt; color:
red">
This is line one
This is line two
This is line three
</p>
</body>
</html>
FaaDoOEngineers.com
161
Embedded Style sheet
• Embedded style sheets are used when a unique style is required
for a document.
• Embedded style are defined in the <head> tag section by using
the <style> tag
• When a large number of style settings are used on a Web page,
there is convenience in packaging the settings together in one
place as an embedded style sheet, rather than having them
scattered as inline style sheets throughout the document.
FaaDoOEngineers.com
162
Syntax of Style sheet
selector {property: value}
Example
p {color: green}
If the value consist of more than one word the value has to be embedded
within quotes.
p {font-family: “sans-serif”}
If more than one property needs to be defined then the properties need to
be separated by semi colon.
p {font-family: “sans-serif” ; color: green}
FaaDoOEngineers.com
163
Example of an Embedded Style sheet
<html>
<head>
<style type="text/css">
p {font-family:"sans-serif"; color: green}
hr {color: red}
body {color:blue; background-color:pink}
</style>
</head>
<body>
<p>This is paragraph one</p>
<hr>
<p> This is paragraph two</p>
<hr>
This line is not within paragraph tag
</body>
</html>
FaaDoOEngineers.com
164
External Style Sheet
• Internal style sheets are used when a unique style is required for
a document.
• Internal style are defined in the <head> tag section by using the
<style> tag
• The different selectors, their properties and values should be
defined within the external style sheet.
• The external style sheet should be saved within a file, with an
extension of .css
FaaDoOEngineers.com
165
External Style sheet
Background is defined
Paragraph font color is
defined
Horizontal color is defined
Mystyle.css
Requires the background,
Paragraph and horizontal
Rule setting defined
In Mystyle.css
FirstPage.html
SecondPage.html
Requires the background,
Paragraph and horizontal
Rule setting defined
In Mystyle.css
Both the html files uses
<link rel="stylesheet" type="text/css"
href=“Mystyle.css" />
FaaDoOEngineers.com
166
Example of External style sheet
body {background-color: yellow}
h1 {font-size: 36pt}
p {margin-left: 50px; background:
pink; color:blue}
hr {color: red}
Mystyle.css
<html>
<head>
<link rel="stylesheet" type="text/css"
href="Mystyle.css" />
</head>
<body>
<h1> This header is 36 pt </h1>
<p> This paragraph has a left margin of
50 pixels<br>
The font color is blue<br>
The background color is pink
</p>
<hr>
</body>
</html>
MyPage.html
FaaDoOEngineers.com
167
Multiple Style sheet
h3 { color: red;
text-align: left;
font-size: 8pt }
Mystyle.css
<html>
<head>
<link rel=“stylesheet” type=“text/css”
href=“Mystyle.css”>
<style type=“text/css”>
h3 {font-size: 20pt}
</style>
</head>
<body>
<h3> This is a header </h3>
---more text----
</body>
</html>
MyPage.html
What will be
the Font size
Of <h3>
8pt or 20 pt??
FaaDoOEngineers.com
168
Multiple Style sheet Continued
• If some properties have been set for the same selector in different style sheets,
the values will be inherited from the more specific style sheet .
h3 { color: red;
text-align: left;
font-size: 8pt }
Mystyle.css
<html>
<head>
<link rel=“stylesheet” type=“text/css”
href=“Mystyle.css”>
<style type=“text/css”>
h3 {font-size: 20pt}
</style>
</head>
<body>
<h3> This is a header </h3>
---more text----
</body>
</html>
MyPage.html
Color: Red
Text-align-left
Font-size- 20pt
Font Size will be Inherited
From the Internal Style sheet
FaaDoOEngineers.com
169
Some common selectors and attributes
Selector property
H1,H2,H3….. font-size,Font-family,font-style , font-weight
Color, margin
P font-size,Font-family,font-style , font-weight
Color, Background-color,text-align, margin
HR color
body Background-color, font-size,Font-family,font-style , font-
weight, margin
FaaDoOEngineers.com
170
Class Selector
• With the class selector you can
define different styles for the
same type of HTML element.
<html>
<head>
<link rel=“stylesheet”
type=“text/css”
href=“Mystyle.css”>
</head>
<body>
<p class=“one”>This paragraph is
Right aligned </p>
<p class=“two”>This paragraph is
Left aligned</p>
</body>
</html>
MyPage.html
p.one {text-align: right; color: white;
background-color: black}
p.two {text-align: left; color: black;
background-color: Red}
Mystyle.css
FaaDoOEngineers.com
171
Uses of <DIV> Tag
1. <DIV> tag is a container for other tags.
2. DIV elements are block elements and work behind
the scenes grouping other tags together.
Some of the attributes of <DIV> tag are:
-> id
-> width
-> height
-> title
-> style
<DIV> tag
FaaDoOEngineers.com
172
Uses of <DIV> Tag
<div id="menu" align="right">
<a href="">HOME</a> | <a href="">CONTACT</a> | <a
href="">ABOUT</a> | <a href="">LINKS</a></div>
<div id="content" align="left" >
<h5>Content Articles</h5>
<p>This paragraph would be your content paragraph
with all of your readable material.</p>
<h5 >Content Article Number Two</h5>
<p>Here's another content article right here.</p>
</div>
Example
<DIV> tag
FaaDoOEngineers.com
173
Uses of <DIV> Tag
Output
<DIV> tag
FaaDoOEngineers.com
174
Using <span> in CSS
• SPAN is a inline tag.
• It is used to format small chunks
of data within another element.
• Combining <span> tag with CSS
allows us to create custom tags.
What is the
Utility of
<span> in
HTML
FaaDoOEngineers.com
175
Using <span> in CSS (contd.)
p { color: white ; background-color:
black}
.example1 {color:blue ; background-
color: yellow ;font-family: "sans-
serif"}
.example2 {color:red ; background-
color: white ;font-family: times}
Mystyle.css
<html>
<head>
<link rel="stylesheet"
type="text/css" href="Mystyle.css" />
</head>
<body>
<p >
This is the first line of the
paragraph<br>
This is the second line of the
paragraph<br>
<span class="example1">This is the
third line of the paragraph<br>
</span>
<span class="example2">This is the
fourth line of the paragraph<br>
</span>
This is the fifth line of the paragraph
</p>
</body>
</html>
MyPage.html
FaaDoOEngineers.com
176
Developing
HTML Forms
FaaDoOEngineers.com
FaaDoO
177
Form
• An HTML form is a section of a document containing normal
content, markup, special elements called controls (checkboxes,
radio buttons, menus, etc.), and labels on those controls.
• Users generally "complete" a form by modifying its controls
(entering text, selecting menu items, etc.), before submitting the
form to an agent for processing (e.g., to a Web server, to a mail
server, etc.)
FaaDoOEngineers.com
178
Form (Contd.)
• A form is defined with the <form> tag.
FaaDoOEngineers.com
179
Form Controls
• TextField:
 Are used to accept user input. It is a single line input control.
• CheckBox
 Checkboxes are used when you want the user to select one or more options
of a limited number of choices.
• RadioButton
 Radio Buttons are used when you want the user to select one of a limited
number of choices.
• Select
 Are used when you want users to choose options from a selectable lists.
• TextArea
 Are used to accept user input. TextArea allows entry of multiple lines.
FaaDoOEngineers.com
180
Form Controls (Contd.)
• PushButton
 Each push button may have client side script associated with the
element's event attributes. When an event occurs (e.g., the user
presses the button, releases it, etc.), the associated script is
triggered.
• Submit Button
 When activated, a submit button submits a form. A form may contain
more than one submit button.
• Reset Button
 When activated, a reset button resets all controls to their initial
values.
FaaDoOEngineers.com
181
Form Controls (Contd)
Form
Component Tag Usage Output
TextField <input> type name value <input type="text" name="t1" value="Paul">
Checkbox <input> type name value <input type="checkbox" name="c1" value="v1">
RadioButton <input> type name value <input type="radio" name="r1" value="v2">
<select> name
<option> value
TextArea
<textarea> row col name <textarea name="n1" row="5" col="20">
<input> type name value <input type="button" name="b1" value="Click">
<input type="submit" name="s1" value="Submit">
<input type="reset" value="Reset">
PushButton
Attribute
ComboBox
<select name="s1"><option value="v1">Display
item</option></select>
Paul
Select anitem
Click
Submit
Reset
FaaDoOEngineers.com
182
Form Controls using Attributes:
INPUT Attribute definitions
• type = text|password|checkbox|radio|submit|reset|file|hidden|image|button
 This attribute specifies the „type of control‟ to create. The default value for
this attribute is "text".
• name = cdata
 This attribute assigns the „control name‟.
• value = cdata
 This attribute specifies the „initial value‟ of the control. It is optional except
when the „type’ attribute has the value "radio" or "checkbox".
• size = cdata
 This attribute tells the initial width of the control. The width is given in
pixels except when „type’ attribute has the value "text" or "password". In
that case, its value refers to the (integer) number of characters.
FaaDoOEngineers.com
183
Form Controls using Attributes:
INPUT Attribute definitions (Contd …)
• maxlength = number
 When the „type’ attribute has the value "text" or "password", this
attribute specifies the maximum number of characters the user may
enter. This number may exceed the specified „size’, in which case the
user should offer a scrolling mechanism. The default value for this
attribute is an unlimited number.
• Checked
 When the „type’ attribute has the value "radio" or "checkbox", this
boolean attribute specifies that the button is on.
• src = uri
 When the „type’ attribute has the value "image", this attribute
specifies the location of the image to be used to decorate the
graphical submit button.
FaaDoOEngineers.com
184
Form Controls using Attributes:
SELECT Attribute definitions
• name = cdata
This attribute assigns the control name.
• size = number
If a SELECT element is presented as a scrolled list box, this
attribute specifies the number of rows in the list that should be
visible at the same time.
• Multiple
If set, this boolean attribute allows multiple selections. If not
set, the SELECT element only permits single selections.
FaaDoOEngineers.com
185
Pre – Selected Options:
• Zero or more choices may be pre-selected for the user. Users
should determine which choices are pre-selected as follows:
 If no „OPTION‟ element has the „selected‟ attribute set, the initial
state has the first option selected.
 If one „OPTION‟ element has the „selected‟ attribute set, it should be
pre-selected.
 If the „SELECT‟ element has the „multiple‟ attribute set and more than
one „OPTION‟ element has the „selected‟ attribute set, they should all
be pre-selected.
 It is considered an error if more than one „OPTION‟ element has the
„selected‟ attribute set and the „SELECT‟ element does not have the
„multiple‟ attribute set.
FaaDoOEngineers.com
186
Example of a Form
<html>
<head>
<title>
Form Example</title>
</head>
<body bgcolor=pink >
<center>
<h3> Data Entry Form</h3>
<form>
<table>
<tr><td>Name</td><td> <input
type="text" name="t1"> </td></tr>
<tr><td>Gender</td><td> <input
type="radio" name=“r1” value=“m”>
Male
<input type="radio" name=“r1”
value=“f”>Female</td></tr>
<tr><td>Qualification</td><td><select
name=“s”>
<option >Select</option>
<option value=“M.Sc”>M Sc</option>
<option value=“M.A.”>MA</option>
<option
value="other">other</option></select
>
</td></tr>
<tr><td> <input type="submit"
value="submit"> </td>
<td> <input type="reset" value="reset">
</td></tr>
</table>
</center>
</form>
</body>
</html>
FaaDoOEngineers.com
187
Output of the Form
FaaDoOEngineers.com
188
Fieldset & Legend Tag
• The fieldset tag is used to group the form elements whilst the legend
tag provides a label for the fieldset.
• The HTML legend tag is used for labelling the fieldset element.
• By using the fieldset tag and the legend tag, you can make your
forms much easier to understand for your users.
FaaDoOEngineers.com
189
Output Required
FaaDoOEngineers.com
190
Code Snippet
<html>
<body>
<fieldset style="text-align:right;">
<legend><b>Address Details</b></legend>
Favorite Address <input type="text" /><br/>
Least Favorite Address <input type="text" /><br/>
Current Address <input type="text" /><br/>
Your Next Address <input type="text" /><br/>
</fieldset>
<br>
<fieldset align="left">
<legend>Personal Info</legend>
Name : <input type="text">
Age : <input type="text">
Gender :
<input type="radio"
name="r1">Male
<input type="radio"
name="r1">Female
</fieldset>
</body>
</html>
FaaDoOEngineers.com
191
<fieldset> tag is used to group the form elements
<html>
<body>
<fieldset style="text-align:right;">
<legend><b>Address Details</b></legend>
Favorite Address <input type="text" /><br/>
Least Favorite Address <input type="text" /><br/>
Current Address <input type="text" /><br/>
Your Next Address <input type="text" /><br/>
</fieldset>
<br>
<fieldset align="left">
<legend>Personal Info</legend>
Name : <input type="text">
Age : <input type="text">
Gender :
<input type="radio"
name="r1">Male
<input type="radio"
name="r1">Female
</fieldset>
</body>
</html>
FaaDoOEngineers.com
192
<legend> tag is used give a suitable label to the group.
<html>
<body>
<fieldset style="text-align:right;">
<legend><b>Address Details</b></legend>
Favorite Address <input type="text" /><br/>
Least Favorite Address <input type="text" /><br/>
Current Address <input type="text" /><br/>
Your Next Address <input type="text" /><br/>
</fieldset>
<br>
<fieldset align="left">
<legend>Personal Info</legend>
Name : <input type="text">
Age : <input type="text">
Gender :
<input type="radio"
name="r1">Male
<input type="radio"
name="r1">Female
</fieldset>
</body>
</html>
FaaDoOEngineers.com
193
Given a Label using legend tag
Created groups using fieldset tag
FaaDoOEngineers.com
194
Summary
• HTML is used for publishing web page.
• A tag is a reference in an HTML document which describes the style and
structure of the document.
• <TABLE> with <TR>,<TH>,<TD> tags are used to construct a tabular
structure in HTML.
• To create a List of items in HTML, tags used are <OL>and <UL>.
• Tags that separate from one line to others are <P>, <BR>, <HR>.
• It is used to include preformatted text into your HTML document.
• <BLOCKQUOTE> tag is used to include indented text in a document.
• The purpose of Logical Character Style tags is to convey the basic semantic
meaning of a piece of text rather than the absolute appearance.
• Physical Character Style tags is used to give your text a different look but
exacting look.
• <Font> tag is used to change the font size, color and face in a document.
FaaDoOEngineers.com
195
Summary (Contd.)
• Special characters are those that has a special meaning in HTML and
those are not found on English keyboards.
• HTML uses the <a> (anchor) tag to create a link to another document.
• In Html images are defined by using the <img> tag
• The <img> tag is a open tag ( does not have a </img>)
• Web style sheets are a form of separation of presentation and content
for web design .
• CSS syntax is made up of three parts: Selector, property and value
• Internal style sheets are used when a unique style is required for a
document.
• Internal style are defined in the <head> tag section by using the <style>
tag
FaaDoOEngineers.com
196
Summary (Contd.)
• Internal style sheets are used when a unique style is required for a
document.
• Internal style are defined in the <head> tag section by using the <style>
tag
• With the class selector you can define different styles for the same type
of HTML element
• <Span> is a inline tag.
• Span is used to format small chunks of data within another element.An
HTML form is a section of a document containing normal content,
markup, special elements called controls.
• Some of the common controls are checkboxes, radio buttons, Textfields,
etc.
• Fieldset & Legend tags are used for grouping form elements and giving
a suitable name to the group respectively.
FaaDoOEngineers.com
197
Test Your Understanding
1. Select the correct option for making a hyperlink?
a. <a href="http://www.w3schools.com">W3Schools</a>
b. <a url="http://www.w3schools.com">W3Schools.com</a>
c. <a>http://www.w3schools.com</a>
d. <a name="http://www.w3schools.com">W3Schools.com</a>
2. Style Sheet can decide presentation of a web page
a. false
b. true
FaaDoOEngineers.com
198
Test Your Understanding (Contd.)
3. The <style> tag should be embedded within:
a. <body>
b. <form>
c. <head>
d. <img>
4. With the _________selector you can define different styles for the same
type of HTML element.
a. Form
b. Button
c. Span
d. class
FaaDoOEngineers.com
199
Test Your Understanding (Contd.)
5. The ___________ attribute of table tag separates text from the cell border
a. CELLPADDING
b. CELLSPACING
c. BORDERSPACING
d. TABLESPACING
6. What is the default font size in a web page.
a. 1
b. 2
c. 3
d. 5
FaaDoOEngineers.com
200
a. <TR>
b. <SPAN>
c. <STRONG>
d. <FIELDSET>
e. <HR>
iii. Creates a horizontal rule.
iv. Creates a new row in a table
v. Used to format small chunks of data.
i. Emphasizes the text enclosed within it.
ii. Used to group the form elements.
Match Group A with B
Group A Group B
Test Your Understanding (Contd.)
FaaDoOEngineers.com
201
References
• http://www.pierobon.org/iis/url.htm
• http://w3schools.com/html
• http://www.ology.org/tilt/cgh/ - Things to consider while
developing web page using HTML.
• http://www.tizag.com/htmlT
• http://www.1stsitefree.com
• http://www.quackit.com/html
FaaDoOFaaDoOEngineers.com

Contenu connexe

Tendances (20)

CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Lecture 2 introduction to html
Lecture 2  introduction to htmlLecture 2  introduction to html
Lecture 2 introduction to html
 
HTML presentation for beginners
HTML presentation for beginnersHTML presentation for beginners
HTML presentation for beginners
 
HTML + CSS Examples
HTML + CSS ExamplesHTML + CSS Examples
HTML + CSS Examples
 
Html
HtmlHtml
Html
 
html-table
html-tablehtml-table
html-table
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
 
(Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS (Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
HTML
HTMLHTML
HTML
 
Html, CSS & Web Designing
Html, CSS & Web DesigningHtml, CSS & Web Designing
Html, CSS & Web Designing
 
Basic HTML
Basic HTMLBasic HTML
Basic HTML
 
How to learn HTML in 10 Days
How to learn HTML in 10 DaysHow to learn HTML in 10 Days
How to learn HTML in 10 Days
 
HTML and CSS crash course!
HTML and CSS crash course!HTML and CSS crash course!
HTML and CSS crash course!
 
Html presentation
Html presentationHtml presentation
Html presentation
 
Html ppt
Html pptHtml ppt
Html ppt
 
Learning Html
Learning HtmlLearning Html
Learning Html
 
Html Frames
Html FramesHtml Frames
Html Frames
 
Css selectors
Css selectorsCss selectors
Css selectors
 
Intro to HTML & CSS
Intro to HTML & CSSIntro to HTML & CSS
Intro to HTML & CSS
 

En vedette

HyperText Markup Language - HTML
HyperText Markup Language - HTMLHyperText Markup Language - HTML
HyperText Markup Language - HTMLSun Technlogies
 
HTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts BasicsHTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts BasicsSun Technlogies
 
Improving the HTML Table
Improving the HTML TableImproving the HTML Table
Improving the HTML Tablelastrand
 
Web html table tags
Web html  table tagsWeb html  table tags
Web html table tagsKainat Ilyas
 
Difference Between HTML and HTML5
Difference Between HTML and HTML5Difference Between HTML and HTML5
Difference Between HTML and HTML5Bapu Graphics India
 
Html 4 01 Weekend Crash Course (2000) 0764547461
Html 4 01 Weekend Crash Course (2000)  0764547461Html 4 01 Weekend Crash Course (2000)  0764547461
Html 4 01 Weekend Crash Course (2000) 0764547461bhuvanann
 
[Basic HTML/CSS] 3. html - table tags
[Basic HTML/CSS] 3. html - table tags[Basic HTML/CSS] 3. html - table tags
[Basic HTML/CSS] 3. html - table tagsHyejin Oh
 
Intro to HTML5
Intro to HTML5Intro to HTML5
Intro to HTML5Vlad Posea
 
Html table tags
Html table tagsHtml table tags
Html table tagseShikshak
 
Gears and HTML 5 @media Ajax London 2008
Gears and HTML 5 @media Ajax London 2008Gears and HTML 5 @media Ajax London 2008
Gears and HTML 5 @media Ajax London 2008dion
 
Html 5 in a big nutshell
Html 5 in a big nutshellHtml 5 in a big nutshell
Html 5 in a big nutshellLennart Schoors
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to htmlvikasgaur31
 

En vedette (20)

HTML: Tables and Forms
HTML: Tables and FormsHTML: Tables and Forms
HTML: Tables and Forms
 
HyperText Markup Language - HTML
HyperText Markup Language - HTMLHyperText Markup Language - HTML
HyperText Markup Language - HTML
 
HTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts BasicsHTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts Basics
 
Html Ppt
Html PptHtml Ppt
Html Ppt
 
Improving the HTML Table
Improving the HTML TableImproving the HTML Table
Improving the HTML Table
 
Web html table tags
Web html  table tagsWeb html  table tags
Web html table tags
 
Html
HtmlHtml
Html
 
HTML Fundamentals
HTML FundamentalsHTML Fundamentals
HTML Fundamentals
 
Difference Between HTML and HTML5
Difference Between HTML and HTML5Difference Between HTML and HTML5
Difference Between HTML and HTML5
 
Html 4 01 Weekend Crash Course (2000) 0764547461
Html 4 01 Weekend Crash Course (2000)  0764547461Html 4 01 Weekend Crash Course (2000)  0764547461
Html 4 01 Weekend Crash Course (2000) 0764547461
 
[Basic HTML/CSS] 3. html - table tags
[Basic HTML/CSS] 3. html - table tags[Basic HTML/CSS] 3. html - table tags
[Basic HTML/CSS] 3. html - table tags
 
Intro to HTML5
Intro to HTML5Intro to HTML5
Intro to HTML5
 
Week 2
Week 2Week 2
Week 2
 
Html table
Html tableHtml table
Html table
 
Html tables examples
Html tables   examplesHtml tables   examples
Html tables examples
 
Html table tags
Html table tagsHtml table tags
Html table tags
 
Gears and HTML 5 @media Ajax London 2008
Gears and HTML 5 @media Ajax London 2008Gears and HTML 5 @media Ajax London 2008
Gears and HTML 5 @media Ajax London 2008
 
Html
HtmlHtml
Html
 
Html 5 in a big nutshell
Html 5 in a big nutshellHtml 5 in a big nutshell
Html 5 in a big nutshell
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 

Similaire à Html

Learn HTML Step By Step
Learn HTML Step By StepLearn HTML Step By Step
Learn HTML Step By StepSatish Chandra
 
HTML Basic, CSS Basic, JavaScript basic.
HTML Basic, CSS Basic, JavaScript basic.HTML Basic, CSS Basic, JavaScript basic.
HTML Basic, CSS Basic, JavaScript basic.Beqa Chacha
 
Additional HTML
Additional HTML Additional HTML
Additional HTML Doeun KOCH
 
How the Web Works Using HTML
How the Web Works Using HTMLHow the Web Works Using HTML
How the Web Works Using HTMLMarlon Jamera
 
HTML Comprehensive Overview
HTML Comprehensive OverviewHTML Comprehensive Overview
HTML Comprehensive OverviewMohamed Loey
 
Introduction to Web Technology and Web Page Development
Introduction to Web Technology and Web Page DevelopmentIntroduction to Web Technology and Web Page Development
Introduction to Web Technology and Web Page DevelopmentBhargaviDalal4
 
Html css java script basics All about you need
Html css java script basics All about you needHtml css java script basics All about you need
Html css java script basics All about you needDipen Parmar
 
Intro to html revised2
Intro to html revised2Intro to html revised2
Intro to html revised2mmvidanes29
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basicsMinea Chem
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basicsNikita Garg
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basicsxu fag
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
Lecture 2 introduction to html basics
Lecture 2 introduction to html basicsLecture 2 introduction to html basics
Lecture 2 introduction to html basicsAliMUSSA3
 
02 HTML-01.pdf
02 HTML-01.pdf02 HTML-01.pdf
02 HTML-01.pdfEshaYasir1
 

Similaire à Html (20)

Learn HTML Step By Step
Learn HTML Step By StepLearn HTML Step By Step
Learn HTML Step By Step
 
Html b smart
Html b smartHtml b smart
Html b smart
 
HTML Basics by software development company india
HTML Basics by software development company indiaHTML Basics by software development company india
HTML Basics by software development company india
 
Html
HtmlHtml
Html
 
Day1
Day1Day1
Day1
 
HTML Basic, CSS Basic, JavaScript basic.
HTML Basic, CSS Basic, JavaScript basic.HTML Basic, CSS Basic, JavaScript basic.
HTML Basic, CSS Basic, JavaScript basic.
 
Additional HTML
Additional HTML Additional HTML
Additional HTML
 
How the Web Works Using HTML
How the Web Works Using HTMLHow the Web Works Using HTML
How the Web Works Using HTML
 
HTML Comprehensive Overview
HTML Comprehensive OverviewHTML Comprehensive Overview
HTML Comprehensive Overview
 
Html
HtmlHtml
Html
 
Introduction to Web Technology and Web Page Development
Introduction to Web Technology and Web Page DevelopmentIntroduction to Web Technology and Web Page Development
Introduction to Web Technology and Web Page Development
 
Html css java script basics All about you need
Html css java script basics All about you needHtml css java script basics All about you need
Html css java script basics All about you need
 
Intro to html revised2
Intro to html revised2Intro to html revised2
Intro to html revised2
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basics
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basics
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basics
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
HTML & CSS.ppt
HTML & CSS.pptHTML & CSS.ppt
HTML & CSS.ppt
 
Lecture 2 introduction to html basics
Lecture 2 introduction to html basicsLecture 2 introduction to html basics
Lecture 2 introduction to html basics
 
02 HTML-01.pdf
02 HTML-01.pdf02 HTML-01.pdf
02 HTML-01.pdf
 

Plus de Lincoln School

Introduccionalasbasesdedatos
IntroduccionalasbasesdedatosIntroduccionalasbasesdedatos
IntroduccionalasbasesdedatosLincoln School
 
Creando diagramas de flujo con dfd
Creando diagramas de flujo con dfdCreando diagramas de flujo con dfd
Creando diagramas de flujo con dfdLincoln School
 
Tema 4 -_introduccion_a_razonamiento_algoritmico
Tema 4 -_introduccion_a_razonamiento_algoritmicoTema 4 -_introduccion_a_razonamiento_algoritmico
Tema 4 -_introduccion_a_razonamiento_algoritmicoLincoln School
 
Tema 3 metodología para la solución de problemas
Tema 3  metodología para la solución de problemasTema 3  metodología para la solución de problemas
Tema 3 metodología para la solución de problemasLincoln School
 
Tema 1 introducción a la computadora
Tema 1   introducción a la computadoraTema 1   introducción a la computadora
Tema 1 introducción a la computadoraLincoln School
 
Historia de los lenguajes de programación
Historia de los lenguajes de programaciónHistoria de los lenguajes de programación
Historia de los lenguajes de programaciónLincoln School
 
Ciclos y Condicionales - Iterate
Ciclos y Condicionales - IterateCiclos y Condicionales - Iterate
Ciclos y Condicionales - IterateLincoln School
 
Ciclos y Condicionales
Ciclos y CondicionalesCiclos y Condicionales
Ciclos y CondicionalesLincoln School
 
Extendiendo el Lenguaje
Extendiendo el LenguajeExtendiendo el Lenguaje
Extendiendo el LenguajeLincoln School
 
Instrucciones Básicas
Instrucciones BásicasInstrucciones Básicas
Instrucciones BásicasLincoln School
 
Programación 2 - karel1
Programación 2 - karel1Programación 2 - karel1
Programación 2 - karel1Lincoln School
 
03 algorithm properties
03 algorithm properties03 algorithm properties
03 algorithm propertiesLincoln School
 
Algorithms and flowcharts1
Algorithms and flowcharts1Algorithms and flowcharts1
Algorithms and flowcharts1Lincoln School
 
Collaborative work with google docs
Collaborative work with google docsCollaborative work with google docs
Collaborative work with google docsLincoln School
 

Plus de Lincoln School (17)

Introduccionalasbasesdedatos
IntroduccionalasbasesdedatosIntroduccionalasbasesdedatos
Introduccionalasbasesdedatos
 
Creando diagramas de flujo con dfd
Creando diagramas de flujo con dfdCreando diagramas de flujo con dfd
Creando diagramas de flujo con dfd
 
Tema 4 -_introduccion_a_razonamiento_algoritmico
Tema 4 -_introduccion_a_razonamiento_algoritmicoTema 4 -_introduccion_a_razonamiento_algoritmico
Tema 4 -_introduccion_a_razonamiento_algoritmico
 
Tema 3 metodología para la solución de problemas
Tema 3  metodología para la solución de problemasTema 3  metodología para la solución de problemas
Tema 3 metodología para la solución de problemas
 
Tema 1 introducción a la computadora
Tema 1   introducción a la computadoraTema 1   introducción a la computadora
Tema 1 introducción a la computadora
 
Historia de los lenguajes de programación
Historia de los lenguajes de programaciónHistoria de los lenguajes de programación
Historia de los lenguajes de programación
 
While karel
While karelWhile karel
While karel
 
Ciclos y Condicionales - Iterate
Ciclos y Condicionales - IterateCiclos y Condicionales - Iterate
Ciclos y Condicionales - Iterate
 
Ciclos y Condicionales
Ciclos y CondicionalesCiclos y Condicionales
Ciclos y Condicionales
 
Extendiendo el Lenguaje
Extendiendo el LenguajeExtendiendo el Lenguaje
Extendiendo el Lenguaje
 
Instrucciones Básicas
Instrucciones BásicasInstrucciones Básicas
Instrucciones Básicas
 
Programación 2
Programación 2Programación 2
Programación 2
 
Programación 2 - karel1
Programación 2 - karel1Programación 2 - karel1
Programación 2 - karel1
 
03 algorithm properties
03 algorithm properties03 algorithm properties
03 algorithm properties
 
Algorithms and flowcharts1
Algorithms and flowcharts1Algorithms and flowcharts1
Algorithms and flowcharts1
 
Collaborative work with google docs
Collaborative work with google docsCollaborative work with google docs
Collaborative work with google docs
 
Movie maker
Movie makerMovie maker
Movie maker
 

Dernier

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 

Dernier (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Html

  • 3. 3 Objectives • Getting Started With HTML  Introducing HTML  How Web pages work  Introduction to Tags  Structure of HTML page • Creating a Web Page  Introduction table, tr, td tags.  Paragraphs and Line breaks  Headings  Creating Ordered and Unordered List • Text Formatting And Alignment  Boldfaces and Italics  Font Size, Color and Typeface  Special Characters FaaDoOEngineers.com
  • 4. 4 • Using Links & Images • Style Sheet Purpose of Style Sheet Style Rules Attaching Style Sheet Defining classes Div tag, Span Tag Using Span • Developing Forms Introducing Forms  Using Standard Form Controls Objectives FaaDoOEngineers.com
  • 5. 5 What is World Wide Web? • The World Wide Web (Web) is a network of information resources. The Web relies on three mechanisms to make these resources readily available to the widest possible audience: A uniform naming scheme for locating resources on the Web (e.g., URIs). Protocols, for access to named resources over the Web (e.g., HTTP). Hypertext, for easy navigation among resources (e.g., HTML). FaaDoOEngineers.com
  • 6. 6 Introducing HTML To publish information for global distribution, one needs a universally understood language, a kind of publishing mother tongue that all computers may potentially understand. The publishing language used by the World Wide Web is HTML (from HyperText Markup Language). What is HTML FaaDoOEngineers.com
  • 7. 7 Introducing HTML HTML contains special markers, or tags, which define the style and structure of the page. Tags are also referred to as elements. What is HTML FaaDoOEngineers.com
  • 8. 8 • Publish online documents with headings, texts, tables, lists, photos, etc. • Retrieve online information via hypertexts links. • Design forms for conducting transactions with remote services, for use in searching for information, making reservations, ordering products, etc. • Include spread-sheets, video clips, sound clips, and other applications directly in their documents. Introducing HTML Uses of HTML FaaDoOEngineers.com
  • 9. 9 How To Access An Web Page Click To Proceed With The Steps FaaDoOEngineers.com
  • 12. 12 Type the url address & Press Enter Key http://www.google.com FaaDoOEngineers.com
  • 13. 13 HTML files Web Server Internet Request Request User makes a request www.google.com http://www.google.com FaaDoOEngineers.com
  • 14. 14 HTML files Web Server Internet Web Page Web Page Google page is returned from the Web Server FaaDoOEngineers.com
  • 16. 16 Introducing HTML A tag is a reference in an HTML document which describes the style and structure of the document. All tag start with < (less than symbol) and end with > (greater than symbol) Tags which mark a beginning have no / (front slash). Tags which mark an ending have a / immediately after <, as in </. What is a Tag FaaDoOEngineers.com
  • 17. 17 Introducing HTML Example on Tag <HTML>, <BODY>, <TITLE> </HTML>, </BODY>, </TITLE> Sample Tags Starting tags / elements Ending tags / elements FaaDoOEngineers.com
  • 18. 18 Introducing HTML Explanation of the HTML code <HTML> <HEAD> <TITLE> My Home Page </TITLE> </HEAD> <!-- Written by Manas K Sahoo --> <!-- Created: 30-May-2007 --> <!-- Organization: IBM --> <BODY>This is where the text goes. </BODY> </HTML> FaaDoOEngineers.com
  • 19. 19 Introducing HTML Explanation of the HTML code <HTML> <HEAD> <TITLE> My Home Page </TITLE> </HEAD> <!-- Written by Manas K Sahoo --> <!-- Created: 30-May-2007 --> <!-- Organization: IBM --> <BODY>This is where the text goes. </BODY> </HTML> Start of an HTML document. FaaDoOEngineers.com
  • 20. 20 Introducing HTML Explanation of the HTML code <HTML> <HEAD> <TITLE> My Home Page </TITLE> </HEAD> <!-- Written by Manas K Sahoo --> <!-- Created: 30-May-2007 --> <!-- Organization: IBM --> <BODY>This is where the text goes. </BODY> </HTML> Indicates to the browser that this is an HTML document. FaaDoOEngineers.com
  • 21. 21 Introducing HTML Explanation of the HTML code <HTML> <HEAD> <TITLE> My Home Page </TITLE> </HEAD> <!-- Written by Manas K Sahoo --> <!-- Created: 30-May-2007 --> <!-- Organization: IBM --> <BODY>This is where the text goes. </BODY> </HTML> HTML document is divided into two sections. 1. <HEAD> …. </HEAD> FaaDoOEngineers.com
  • 22. 22 Introducing HTML Explanation of the HTML code <HTML> <HEAD> <TITLE> My Home Page </TITLE> </HEAD> <!-- Written by Manas K Sahoo --> <!-- Created: 30-May-2007 --> <!-- Organization: IBM --> <BODY>This is where the text goes. </BODY> </HTML> HTML document is divided into two sections. 2. <BODY> …. </BODY> FaaDoOEngineers.com
  • 23. 23 Introducing HTML Explanation of the HTML code <HTML> <HEAD> <TITLE> My Home Page </TITLE> </HEAD> <!-- Written by Manas K Sahoo --> <!-- Created: 30-May-2007 --> <!-- Organization: IBM --> <BODY>This is where the text goes. </BODY> </HTML> Shows the contents in the browser title bar. Generally placed inside Head tag. FaaDoOEngineers.com
  • 24. 24 Introducing HTML Explanation of the HTML code <HTML> <HEAD> <TITLE> My Home Page </TITLE> </HEAD> <!-- Written by Manas K Sahoo --> <!-- Created: 30-May-2007 --> <!-- Organization: IBM --> <BODY>This is where the text goes. </BODY> </HTML> Indicates comment tag. Can be placed anywhere in the document. FaaDoOEngineers.com
  • 25. 25 Introducing HTML Explanation of the HTML code <HTML> <HEAD> <TITLE> My Home Page </TITLE> </HEAD> <!-- Written by Manas K Sahoo --> <!-- Created: 30-May-2007 --> <!-- Organization: IBM --> <BODY>This is where the text goes. </BODY> </HTML> Signal the end of HTML document. FaaDoOEngineers.com
  • 26. 26 Introducing HTML 1. Range / Container tags 2. Standalone / Point tags Kinds of Tags They are called so because they cover a range of text. Example : <HTML>, <HEAD>, <BODY>, <TITLE> Those tags which do not need an ending. Example: <HR>, <BR> FaaDoOEngineers.com
  • 28. 28 Line Separators • Tags used for separating one line with other can be classifies as follows:- 1. <P> tag 2. <BR> tag 3. <HR> tag FaaDoOEngineers.com
  • 29. 29 The <P> Tag • Normally all text in an HTML document is treated like one long paragraph. Indented or blank lines which normally indicate start of paragraphs in text are ignored. • To separate your text into paragraphs use the • The <P> tag forces an end of line and forces a blank line before the next paragraph. <P> tag. FaaDoOEngineers.com
  • 31. 31 <p>This is should be the end of my first paragraph in HTML.</p> <p>This should be the start of my second paragraph in HTML.</p> <p>And this is should be my third paragraph in HTML.</p> Code Snippet To Fulfill the Requirement FaaDoOEngineers.com
  • 32. 32 <p>This is should be the end of my first paragraph in HTML.</p> <p>This should be the start of my second paragraph in HTML.</p> <p>And this is should be my third paragraph in HTML.</p> <p> tag forces an end of line and forces a blank line before the next paragraph. FaaDoOEngineers.com
  • 33. 33 <p>This is should be the end of my first paragraph in HTML.</p> <p>This should be the start of my second paragraph in HTML.</p> <p>And this is should be my third paragraph in HTML.</p> <p> tag forces an end of line and forces a blank line before the next paragraph. Ends the paragraph tag. FaaDoOEngineers.com
  • 34. 34 The <BR> Tag • Used to control the line breaks. • Use single spacing among the lines unlike <p> tag that uses double spacing among the paragraph. • Does not have a closing braces. FaaDoOEngineers.com
  • 36. 36 This is should be the end of my first paragraph in HTML.<br> This should be the start of my second paragraph in HTML.<br> <p>And this is should be my third paragraph in HTML.<br> Code Snippet To Fulfill the Requirement FaaDoOEngineers.com
  • 37. 37 This is should be the end of my first paragraph in HTML.<br> This should be the start of my second paragraph in HTML.<br> <p>And this is should be my third paragraph in HTML.<br> Forces line break with one line spacing between two lines. FaaDoOEngineers.com
  • 38. 38 The <HR> tag • The <HR> tag draws a horizontal line across the page. • It acts a paragraph break. • There is no need to use the <BR> before or after the <HR> tag. FaaDoOEngineers.com
  • 40. 40 This is should be the end of my first paragraph in HTML.<hr> This should be the start of my second paragraph in HTML.<hr> And this is should be my third paragraph in HTML.<hr> Code Snippet To Fulfill the Requirement FaaDoOEngineers.com
  • 41. 41 This is should be the end of my first paragraph in HTML.<hr> This should be the start of my second paragraph in HTML.<hr> And this is should be my third paragraph in HTML.<hr> Draws a horizontal line across the page. FaaDoOEngineers.com
  • 42. 42 <HR> tag Attributes <hr color=“red”> 1. Color Attribute How To Use <hr color=“blue”> <hr color=“pink”> FaaDoOEngineers.com
  • 43. 43 <HR> tag Attributes <hr width=“50%”> 2. Width Attribute How To Use <hr color=“blue” width=“100%”> <hr width=“500”> Default alignment of HR is center. FaaDoOEngineers.com
  • 44. 44 <HR> tag Attributes <hr align=“left” width=“50%”> 3. Align Attribute How To Use <hr align=“right” width=“50%”> <hr align=“center” width=“50%”> FaaDoOEngineers.com
  • 45. 45 <HR> tag Attributes <hr size=“5”> 4. Size Attribute How To Use <hr size=“3” color=“red”> <hr align=“center” width=“50%” size=“2”> FaaDoOEngineers.com
  • 46. 46 The Headings Tags • To add headings in the HTML document use tag where, n represent number from 1 to 6. <Hn> <H1> </H1>Some text here <H2> </H2> <H3> </H3> <H4> </H4> <H5> </H5> <H6> </H6> Some text here Some text here Some text here Some text here Some text here FaaDoOEngineers.com
  • 47. 47 Listing In HTML • A common applications of HTML is to display the list of items. • The most popular types of lists that can be created using HTML are:  Unordered List  Ordered List FaaDoOEngineers.com
  • 48. 48 Unordered List • When the list of contents that you want to display don‟t have to follow any sequence then you can use Unordered list. • Each item in the unordered list is indented. For Example, while creating list of Electronic products, where sequence of occurrence does not matter. <UL> tag is used to create a Unordered list. FaaDoOEngineers.com
  • 49. 49 Unordered List • When the list of contents that you want to display don‟t have to follow any sequence then you can use Unordered list. • Each item in the unordered list is indented. For Example, while creating list of Electronic products, where sequence of occurrence does not matter. <LI> tag identifies a item in the list. FaaDoOEngineers.com
  • 50. 50 Unordered List <HTML> <BODY> <H3>List of Electronic Products</H3> <UL> <LI>T.V.</LI> <LI>VCD</LI> <LI>DVD</LI> <LI>REFRIGERATOR</LI> <LI>WASHING MACHINE</LI> <LI>MICRO OVEN</LI> </UL> </BODY> </HTML> Check Out An Example FaaDoOEngineers.com
  • 52. 52 Ordered List • When the list of contents that you want to display have to follow a sequence. • Each item in the ordered list is indented. • For Example, creating a list of students based on their merit. <OL> tag is used to create a Ordered list. FaaDoOEngineers.com
  • 53. 53 Ordered List <HTML> <BODY> <H3>List of Fortune 500 Companies – Industry: Computers, Office Equipment Year 2006 Survey </H3> <OL> <LI>IBM</LI> <LI>HP</LI> <LI>Dell</LI> <LI>NEC</LI> <LI>Fujitsu</LI> <LI>Canon</LI> </OL> </BODY> </HTML> Check Out An Example FaaDoOEngineers.com
  • 56. 56 1. <PRE> tag Character Styles 2. <BLOCKQUOTE> tag 3. <ADDRESS> tag 4. Logical Character Highlighting tags 5. Physical Character Highlighting tags Text Formatting FaaDoOEngineers.com
  • 57. 57 1. <PRE> tag Character Styles • It is used to include preformatted text into your HTML document. • Text will appeared exactly as typed including, tabs and returns. Text Formatting (Contd.) FaaDoOEngineers.com
  • 58. 58 1. <PRE> tag Character Styles <pre> This is should be the end of my first paragraph in HTML. This should be the start of my second paragraph in HTML.</pre> And this is should be my third paragraph in HTML. Sample Code Text Formatting (Contd.) FaaDoOEngineers.com
  • 59. 59 1. <PRE> tag Character Styles Sample Output Text Formatting (Contd.) FaaDoOEngineers.com
  • 60. 60 2. <BLOCKQUOTE> tag Character Styles • Used to include indented text in a document. • Both the right and left margin are indented. Text Formatting (Contd.) FaaDoOEngineers.com
  • 61. 61 2. <BLOCKQUOTE> tag Character Styles Most Popular Quote of Shakespeare : <BLOCKQUOTE> To Be, Or Not To Be: That Is The Question </BLOCKQUOTE> Sample Code Text Formatting (Contd.) FaaDoOEngineers.com
  • 62. 62 2. <BLOCKQUOTE> tag Character Styles Sample Output Text Formatting (Contd.) FaaDoOEngineers.com
  • 63. 63 3. <ADDRESS> tag Character Styles • It defines text that gives an address or other contact information. • It is displayed in italic. • Generally, displayed in the bottom of the page. Text Formatting (Contd.) FaaDoOEngineers.com
  • 64. 64 3. <ADDRESS> tag Character Styles IBM stands for International Business Machines. <hr color=“blue”> The HeadQuarter is located at: <ADDRESS> IBM Armonk, <BR>New York, USA. </ADDRESS> Sample Code Text Formatting (Contd.) FaaDoOEngineers.com
  • 65. 65 3. <ADDRESS> tag Character Styles Sample Output Text Formatting (Contd.) FaaDoOEngineers.com
  • 66. 66 4. Character Styles • Logical Character Highlighters are also known as Idiomatic styles tags. • The purpose of logical tags is to convey the basic semantic meaning of a piece of text rather than the absolute appearance. • It is used to give your text a different look when displayed by browsers. • Browser handle the look and feel of the logical tag. Logical Character Highlighting tags Text Formatting (Contd.) FaaDoOEngineers.com
  • 67. 67 4. Character Styles Logical Character Highlighting tags Name Tag Example Strong <STRONG> This is STRONG text Emphasis <EM> This is EMphasized text Code <CODE> This is CODEd text Keyboard <KBD> This is “KeyBoarD” text Variable <VAR> This is VARiable text Text Formatting (Contd.) FaaDoOEngineers.com
  • 68. 68 5. Character Styles • Physical Character Highlighters are also known as Typographical styles tags. • It is used to give your text a different look but exacting look. • Not all browsers support physical styles. Physical Character Highlighting tags Text Formatting (Contd.) FaaDoOEngineers.com
  • 69. 69 5. Character Styles Physical Character Highlighting tags Name Tag Example Bold <B> This is Bold text Italics <I> This is Italicized text Underline <U> This is a underlined text Teletype <TT> This is TeleType text Superscript <SUP> X2Y3 Subscript <SUB> H2SO4 Text Formatting (Contd.) FaaDoOEngineers.com
  • 70. 70 Font Tag • It is used to change the font color, fontsize, fontfaceof text in an HTML document. Text Formatting (Contd.) FaaDoOEngineers.com
  • 71. 71 1. Size Attributes of Font Tag 2. Color 3. Face Text Formatting (Contd.) FaaDoOEngineers.com
  • 72. 72 1. Size Attributes of Font Tag Default font size is 3. Largest font size can be set is 7. Smallest is 1. The primary <FONT> attribute is SIZE=x, where x is an absolute value ranging from 1 to 7 or a relative vale (+/-). Text Formatting (Contd.) FaaDoOEngineers.com
  • 73. 73 1. Size Attributes of Font Tag Html Code Output <FONT SIZE=4>HTML is Fun</FONT> HTML is Fun <FONT SIZE=+1>HTML is Fun</FONT> HTML is Fun <FONT SIZE=1>HTML is Fun</FONT> HTML is Fun <FONT SIZE=-2>HTML is Fun</FONT> HTML is Fun Text Formatting (Contd.) FaaDoOEngineers.com
  • 74. 74 2. Color Attributes of Font Tag There are 3 different methods to set color. i. Generic Coloring System ii. RGB Coloring System iii. Hexadecimal Coloring System Text Formatting (Contd.) FaaDoOEngineers.com
  • 75. 75 2. Color Attributes of Font Tag i. Generic Coloring System Generics colors are preset HTML coded colors where the value is simply the name of each color. Text Formatting (Contd.) FaaDoOEngineers.com
  • 76. 76 2. Color Attributes of Font Tag i. Generic Coloring System Black Gray Silver White Yellow Lime Aqua Fuchsia Red Green Blue Purple Maroon Olive Navy Teal Sample Generic Basic Colors Text Formatting (Contd.) FaaDoOEngineers.com
  • 77. 77 2. Color Attributes of Font Tag ii. RGB Coloring System RGB stands for Red, Green, Blue. Each can have a value from 0 (none of that color) to 255 (fully that color). The format for RGB is – RGB (Red, Green, Blue) Text Formatting (Contd.) FaaDoOEngineers.com
  • 78. 78 2. Color Attributes of Font Tag ii. RGB Coloring System <font color=RGB(255,0,0)>Confidence</font> Confidence <font color=RGB(255,255,0)>Confidence</font> Confidence <font color=RGB(0,0,255)>Confidence</font> Confidence <font color=RGB(255,255,255)>Confidence</font> Confidence OutputExample Text Formatting (Contd.) FaaDoOEngineers.com
  • 79. 79 2. Color Attributes of Font Tag iii. Hexadecimal Coloring System A hexadecimal is a 6 digit representation of a color. XX XX XX Red Green Blue Text Formatting (Contd.) FaaDoOEngineers.com
  • 80. 80 2. Color Attributes of Font Tag iii. Hexadecimal Coloring System <font color=“#FF0000”>Confidence</font> Confidence <font color=“#FFFF00”>Confidence</font> Confidence <font color=“#0000FF”>Confidence</font> Confidence <font color=“#FFFFFF”>Confidence</font> Confidence Example Output Text Formatting (Contd.) FaaDoOEngineers.com
  • 81. 81 Color Color Name Hexadecimal Value Color Color Name Hexadecimal Value Black #000000 Green #008000 Silver #c0c0c0 Lime #00ff00 Gray #808080 Olive #808000 White #ffffff Yellow #ffff00 Maroon #800000 Navy #000080 Red #ff0000 Blue #0000ff Purple #800080 Teal #008080 Fushia #ff00ff Aqua #00ffff Text Formatting (Contd.) FaaDoOEngineers.com
  • 82. 82 3. Face Attributes of Font Tag The font face attribute is used to specify the font name. Text Formatting (Contd.) FaaDoOEngineers.com
  • 83. 83 3. Attributes of Font Tag <font face=“Serif”>Confidence</font> Confidence <font face=“Courier”>Confidence</font> Confidence <font face=“Palatino”>Confidence</font> Confidence <font face=“Monotype Corsiva”>Confidence</font> Confidence Output Example Face Code Snippet Text Formatting (Contd.) FaaDoOEngineers.com
  • 84. 84 Special Characters <html> <body> <h2><b>&lt;MARQUEE&gt;</b> is used to scroll the enclosing text.</h2> </body> </html> Exampl e Text Formatting (Contd.) FaaDoOEngineers.com
  • 85. 85 Special Characters Output Text Formatting (Contd.) FaaDoOEngineers.com
  • 87. 87 Using Links • The Anchor Tag  HTML uses the <a> (anchor) tag to create a link to another document.  Attributes of <a>(anchor) tag • href : is used to address the document to link to, and the words between the open and close of the anchor tag will be displayed as a hyperlink. Syntax: <a href=”url”>Text to be displayed</a> FaaDoOEngineers.com
  • 88. 88 Using Links (Contd.) Attributes of <a>(anchor) tag • target : The target attribute defines where the linked document will be opened. Syntax: <a href=“http://w3.ibm.com” target=“where to place the document”>Text to be displayed</a> • name :The name attribute is used to create a named anchor. When using named anchors we can create links that can jump directly into a specific section on a page. Syntax <a name=“label”>Text to be displayed</a> FaaDoOEngineers.com
  • 89. 89 Example of a Hyperlink <html> <head> <title>Example of a Hyperlink</title> <head> <body> <a href=“http://w3.IBM.com”> IBM</a> <a href=“http://w3.IBM.com” target=“_blank”>IBM</a> ---- other information within body tag------- </body> </html> The word IBM will be highlighted , and on clicking IBM the user will be taken to the w3 pages of IBM, the page will be opened on the same window The word IBM will be highlighted , and on clicking IBM the user will be taken to the w3 pages of IBM, the page will be opened on a new window. FaaDoOEngineers.com
  • 90. 90 Example of Naming a link and accessing it <html> <body> <a name=“locations”> locations</a> Kolkata, Bangalore, Hyd, Pune, Chandigarh, Gurgoan ----- other information ---------- <a href=“#locations”>IBM Location In India</a> </body> </html> On Clicking on IBM Location in India you will be linked to the section which has been named as locations FaaDoOEngineers.com
  • 91. 91 Embedding Images • The image tag In Html images are defined by using the <img> tag The <img> tag is a open tag ( does not have a </img>) Attributes of <img> tag • src : To display an image on a page, you need to use the src attribute . The value of the src is the url of the image to be displayed • Syntax <img src=“url”> FaaDoOEngineers.com
  • 92. 92 Embedding images ( contd.) Attributes of <img> tag • alt :The alt attribute is used to define an "alternate text" for an image. The value of the alt attribute is an author-defined text: • Syntax <img src=“url” alt=“user defined text”> • width & height : the size of the image can be controlled by using the width and height attributes • Syntax <img src=“url” width=“size in pixels” height=“size in pixels”> FaaDoOEngineers.com
  • 93. 93 Embedding images(contd.) Attributes of <img> tag • align : An image can be aligned with the surrounding text by using the align attribute • Syntax <img src=“url” width=“value in pixels” height=“value in pixels” align=“positon, ie left,right,top bottom…” > • Images can be used as hyperlinks also. <a href=“http://w3.ibm.com”> <img src=“logo.gif” width=“30 height=“40” ></a> FaaDoOEngineers.com
  • 94. 94 Example of an embedded image <html> <body> <p> An image <img src=“home.gif" align="bottom" width="48" height="48"> in the text </p> <p> An image <img src ="home.gif" align="middle" width="48" height="48"> in the text </p> </body> </html> FaaDoOEngineers.com
  • 95. 95 HTML Table • Table allows to organize and present data in an orderly and concise manner. • Tabular structures were introduced with HTML 3.2. • A table can contains wide variety of information, such as headers, anchors, lists, paragraphs, forms, images, preformatted text and even nested tables. • HTML tables are composed of rows and columns. FaaDoOEngineers.com
  • 97. 97 <html> <body> <table border=“1”> <caption>IBM Strategic Business Unit</caption> <tr> <th>Unit Name</th> <th>Description</th> </tr> <tr> <td>BCS</td> <td>Business Consultancy Services</td> </tr> <tr> <td>SWG</td> <td>Software Group</td> </tr> </table> </body> </html> Code Snippet To Fulfill the Requirement FaaDoOEngineers.com
  • 98. 98 <html> <body> <table border=“1”> <caption>IBM Strategic Business Unit</caption> <tr> <th>Unit Name</th> <th>Description</th> </tr> <tr> <td>BCS</td> <td>Business Consultancy Services</td> </tr> <tr> <td>SWG</td> <td>Software Group</td> </tr> </table> </body> </html> For starting a table FaaDoOEngineers.com
  • 99. 99 <html> <body> <table border=“1”> <caption>IBM Strategic Business Unit</caption> <tr> <th>Unit Name</th> <th>Description</th> </tr> <tr> <td>BCS</td> <td>Business Consultancy Services</td> </tr> <tr> <td>SWG</td> <td>Software Group</td> </tr> </table> </body> </html> It is an attribute of table tag to specify the thickness of the border of the table in pixels. FaaDoOEngineers.com
  • 100. 100 Table Border set to 1 FaaDoOEngineers.com
  • 101. 101 If Table Border set to 5 FaaDoOEngineers.com
  • 102. 102 <html> <body> <table border=“1”> <caption>IBM Strategic Business Unit</caption> <tr> <th>Unit Name</th> <th>Description</th> </tr> <tr> <td>BCS</td> <td>Business Consultancy Services</td> </tr> <tr> <td>SWG</td> <td>Software Group</td> </tr> </table> </body> </html> For starting a table For ending a table FaaDoOEngineers.com
  • 103. 103 <html> <body> <table border=“1”> <caption>IBM Strategic Business Unit</caption> <tr> <th>Unit Name</th> <th>Description</th> </tr> <tr> <td>BCS</td> <td>Business Consultancy Services</td> </tr> <tr> <td>SWG</td> <td>Software Group</td> </tr> </table> </body> </html> For starting a table caption, It is like a title which resides outside the border of the table. It is an optional attribute. FaaDoOEngineers.com
  • 104. 104 <html> <body> <table border=“1”> <caption>IBM Strategic Business Unit</caption> <tr> <th>Unit Name</th> <th>Description</th> </tr> <tr> <td>BCS</td> <td>Business Consultancy Services</td> </tr> <tr> <td>SWG</td> <td>Software Group</td> </tr> </table> </body> </html> For ending a table caption For starting a table caption, It is like a title which resides outside the border of the table. It is an optional attribute. FaaDoOEngineers.com
  • 106. 106 <html> <body> <table border=“1”> <caption>IBM Strategic Business Unit</caption> <tr> <th>Unit Name</th> <th>Description</th> </tr> <tr> <td>BCS</td> <td>Business Consultancy Services</td> </tr> <tr> <td>SWG</td> <td>Software Group</td> </tr> </table> </body> </html> For starting a table row FaaDoOEngineers.com
  • 107. 107 <html> <body> <table border=“1”> <caption>IBM Strategic Business Unit</caption> <tr> <th>Unit Name</th> <th>Description</th> </tr> <tr> <td>BCS</td> <td>Business Consultancy Services</td> </tr> <tr> <td>SWG</td> <td>Software Group</td> </tr> </table> </body> </html> For starting a table row For ending a table row. FaaDoOEngineers.com
  • 109. 109 <html> <body> <table border=“1”> <caption>IBM Strategic Business Unit</caption> <tr> <th>Unit Name</th> <th>Description</th> </tr> <tr> <td>BCS</td> <td>Business Consultancy Services</td> </tr> <tr> <td>SWG</td> <td>Software Group</td> </tr> </table> </body> </html> For providing a table heading. By default the header cell will appear in bolder type and the default alignment is center. FaaDoOEngineers.com
  • 110. 110 <html> <body> <table border=“1”> <caption>IBM Strategic Business Unit</caption> <tr> <th>Unit Name</th> <th>Description</th> </tr> <tr> <td>BCS</td> <td>Business Consultancy Services</td> </tr> <tr> <td>SWG</td> <td>Software Group</td> </tr> </table> </body> </html> For providing a table heading. By default the header cell will appear in bolder type and the default alignment is center. For ending a table heading. FaaDoOEngineers.com
  • 112. 112 <html> <body> <table border=“1”> <caption>IBM Strategic Business Unit</caption> <tr> <th>Unit Name</th> <th>Description</th> </tr> <tr> <td>BCS</td> <td>Business Consultancy Services</td> </tr> <tr> <td>SWG</td> <td>Software Group</td> </tr> </table> </body> </html> For providing the table data. By default the alignment is left. FaaDoOEngineers.com
  • 113. 113 <html> <body> <table border=“1”> <caption>IBM Strategic Business Unit</caption> <tr> <th>Unit Name</th> <th>Description</th> </tr> <tr> <td>BCS</td> <td>Business Consultancy Services</td> </tr> <tr> <td>SWG</td> <td>Software Group</td> </tr> </table> </body> </html> For providing the table data. By default the alignment is left. For ending a table data tag. FaaDoOEngineers.com
  • 116. 116 <table border="1"> <caption>ROWSPAN Example</caption> <tr><th>Group Name</th> <th>SubGroup Name</th> <th>Group Name</th> <th>SubGroup Name</th> </tr> <TR> <td ROWSPAN="4"> Group 1</td> <td>1a</td> <td ROWSPAN="4"> Group 2</td><td>2a</td> </tr> <tr> <td>1b</td> <td>2b</td> </tr> <tr> <td>1c</td> <td>2c</td> </tr> <tr> <td>1d</td> <td>2d</td> </tr> </table> Code Snippet To Fulfill the Requirement FaaDoOEngineers.com
  • 117. 117 <table border="1"> <caption>ROWSPAN Example</caption> <tr><th>Group Name</th> <th>SubGroup Name</th> <th>Group Name</th> <th>SubGroup Name</th> </tr> <TR> <td ROWSPAN="4"> Group 1</td> <td>1a</td> <td ROWSPAN="4"> Group 2</td><td>2a</td> </tr> <tr> <td>1b</td> <td>2b</td> </tr> <tr> <td>1c</td> <td>2c</td> </tr> <tr> <td>1d</td> <td>2d</td> </tr> </table> This attribute is used to span cell more than one row. In this case it will span the 1st column into four rows including the current row. FaaDoOEngineers.com
  • 118. 118 This cell is spanned to 4 rows FaaDoOEngineers.com
  • 119. 119 <table border="1"> <caption>ROWSPAN Example</caption> <tr><th>Group Name</th> <th>SubGroup Name</th> <th>Group Name</th> <th>SubGroup Name</th> </tr> <TR> <td ROWSPAN="4"> Group 1</td> <td>1a</td> <td ROWSPAN="4"> Group 2</td><td>2a</td> </tr> <tr> <td>1b</td> <td>2b</td> </tr> <tr> <td>1c</td> <td>2c</td> </tr> <tr> <td>1d</td> <td>2d</td> </tr> </table> The 3rd column is spanning more 4 rows including the current row.. FaaDoOEngineers.com
  • 120. 120 This cell is spanned to 4 rows FaaDoOEngineers.com
  • 123. 123 <table border="1"> <caption>ROWSPAN Example</caption> <tr><th>Group Name</th> <th>SubGroup Name</th> <th>Group Name</th> <th>SubGroup Name</th> </tr> Analyzing The Code FaaDoOEngineers.com
  • 125. 125 <table border="1"> <caption>ROWSPAN Example</caption> <tr><th>Group Name</th> <th>SubGroup Name</th> <th>Group Name</th> <th>SubGroup Name</th> </tr> <TR> <td ROWSPAN="4"> Group 1</td> <td>1a</td> <td ROWSPAN="4"> Group 2</td><td>2a</td> </tr> Analyzing The Code FaaDoOEngineers.com
  • 127. 127 <table border="1"> <caption>ROWSPAN Example</caption> <tr><th>Group Name</th> <th>SubGroup Name</th> <th>Group Name</th> <th>SubGroup Name</th> </tr> <TR> <td ROWSPAN="4"> Group 1</td> <td>1a</td> <td ROWSPAN="4"> Group 2</td><td>2a</td> </tr> Analyzing The Code <tr> <td>1b</td> <td>2b</td> </tr> FaaDoOEngineers.com
  • 129. 129 <table border="1"> <caption>ROWSPAN Example</caption> <tr><th>Group Name</th> <th>SubGroup Name</th> <th>Group Name</th> <th>SubGroup Name</th> </tr> <TR> <td ROWSPAN="4"> Group 1</td> <td>1a</td> <td ROWSPAN="4"> Group 2</td><td>2a</td> </tr> Analyzing The Code <tr> <td>1b</td> <td>2b</td> </tr> <tr> <td>1c</td> <td>2c</td> </tr> FaaDoOEngineers.com
  • 131. 131 <table border="1"> <caption>ROWSPAN Example</caption> <tr><th>Group Name</th> <th>SubGroup Name</th> <th>Group Name</th> <th>SubGroup Name</th> </tr> <TR> <td ROWSPAN="4"> Group 1</td> <td>1a</td> <td ROWSPAN="4"> Group 2</td><td>2a</td> </tr> Analyzing The Code <tr> <td>1b</td> <td>2b</td> </tr> <tr> <td>1c</td> <td>2c</td> </tr> <tr> <td>1d</td> <td>2d</td> </tr> </table> FaaDoOEngineers.com
  • 134. 134 <table border="1"> <caption>COLSPAN Example</caption> <tr> <th colspan="5"> Product Description</th> </tr> <tr> <th> Product Code</th> <th> Product Name</th> <th colspan="2"> Price</th> </tr> <tr> <td colspan="2">&nbsp;</td><td>Rs.</td><td>Ps.</td> </tr> <tr> <td>A001</td><td>AAA</td> <td>150</td><td>00</td> </tr> <tr> <td>B002</td><td>BBB</td> <td>120</td><td>99</td> </tr> <tr> <td>C002</td><td>CCC</td> <td>250</td><td>00</td> </tr> </table> Code Snippet To Fulfill the Requirement FaaDoOEngineers.com
  • 135. 135 <table border="1"> <caption>COLSPAN Example</caption> <tr> <th colspan="5"> Product Description</th> </tr> <tr> <th> Product Code</th> <th> Product Name</th> <th colspan="2"> Price</th> </tr> <tr> <td colspan="2">&nbsp;</td><td>Rs.</td><td>Ps.</td> </tr> <tr> <td>A001</td><td>AAA</td> <td>150</td><td>00</td> </tr> <tr> <td>B002</td><td>BBB</td> <td>120</td><td>99</td> </tr> <tr> <td>C002</td><td>CCC</td> <td>250</td><td>00</td> </tr> </table> This attribute is used to span cell more than one column. In this case it will span the 1st column into five more nested columns. FaaDoOEngineers.com
  • 136. 136 This cell is spanned to 5 columns FaaDoOEngineers.com
  • 137. 137 <table border="1"> <caption>COLSPAN Example</caption> <tr> <th colspan="5"> Product Description</th> </tr> <tr> <th> Product Code</th> <th> Product Name</th> <th colspan="2"> Price</th> </tr> <tr> <td colspan="2">&nbsp;</td><td>Rs.</td><td>Ps.</td> </tr> <tr> <td>A001</td><td>AAA</td> <td>150</td><td>00</td> </tr> <tr> <td>B002</td><td>BBB</td> <td>120</td><td>99</td> </tr> <tr> <td>C002</td><td>CCC</td> <td>250</td><td>00</td> </tr> </table> It will span the 3rd column into two more nested columns. FaaDoOEngineers.com
  • 138. 138 This cell is spanned to 2 columns FaaDoOEngineers.com
  • 139. 139 <table border="1"> <caption>COLSPAN Example</caption> <tr> <th colspan="5"> Product Description</th> </tr> <tr> <th> Product Code</th> <th> Product Name</th> <th colspan="2"> Price</th> </tr> <tr> <td colspan="2">&nbsp;</td><td>Rs.</td><td>Ps.</td> </tr> <tr> <td>A001</td><td>AAA</td> <td>150</td><td>00</td> </tr> <tr> <td>B002</td><td>BBB</td> <td>120</td><td>99</td> </tr> <tr> <td>C002</td><td>CCC</td> <td>250</td><td>00</td> </tr> </table> It will span the 3rd row 1st column into two columns. In other words, it will merge the 1st two columns of the 3rd row. FaaDoOEngineers.com
  • 140. 140 This cell is spanned to 2 columns FaaDoOEngineers.com
  • 141. 141 Some More Attributes of Table tag • Cellspacing - The CELLSPACING attribute creates a space, or border, of the specified number of pixels, between each cell. • Cellpadding - The CELLPADDING attribute separates text of the cell from the cell border with a padding with the specified number of pixels. • Width - specify the width of the table FaaDoOEngineers.com
  • 142. 142 USING CELLSPACING ATTRIBUTE <html> <body> <table cellspacing=“25" border="1"> <tr><th>Table Heading 1</th> <th>Table Heading 2</th> </tr> <tr><td>Table Contents 1</td> <td>Table Contents 2</td> </tr> </body> </html> FaaDoOEngineers.com
  • 143. 143 USING CELLSPACING ATTRIBUTE <html> <body> <table cellspacing=“25" border="1"> <tr><th>Table Heading 1</th> <th>Table Heading 2</th> </tr> <tr><td>Table Contents 1</td> <td>Table Contents 2</td> </tr> </body> </html> FaaDoOEngineers.com
  • 144. 144 Vertical Cell spacing Horizontal Cell spacing FaaDoOEngineers.com
  • 145. 145 USING CELLPADDING ATTRIBUTE <html> <body> <table cellpadding=“25" border="1"> <tr><th>Table Heading 1</th> <th>Table Heading 2</th> </tr> <tr><td>Table Contents 1</td> <td>Table Contents 2</td> </tr> </body> </html> FaaDoOEngineers.com
  • 146. 146 USING CELLPADDING ATTRIBUTE <html> <body> <table cellpadding=“25" border="1"> <tr><th>Table Heading 1</th> <th>Table Heading 2</th> </tr> <tr><td>Table Contents 1</td> <td>Table Contents 2</td> </tr> </body> </html> FaaDoOEngineers.com
  • 147. 147 Vertical Cell padding Horizontal Cell padding FaaDoOEngineers.com
  • 148. 148 USING WIDTH ATTRIBUTE <html> <body> <table width=“80%" border="1"> <tr><th>Table Heading 1</th> <th>Table Heading 2</th> </tr> <tr><td>Table Contents 1</td> <td>Table Contents 2</td> </tr> </body> </html> FaaDoOEngineers.com
  • 149. 149 USING WIDTH ATTRIBUTE <html> <body> <table width=“80%" border="1"> <tr><th>Table Heading 1</th> <th>Table Heading 2</th> </tr> <tr><td>Table Contents 1</td> <td>Table Contents 2</td> </tr> </body> </html> FaaDoOEngineers.com
  • 151. 151 if Cell Width = 20% FaaDoOEngineers.com
  • 152. 152 Table Alignment Related Attribute • HTML tables can be aligned on the page, and cell content can be aligned within the cell. This attribute use to align HORIZONTALLY is ALIGN CENTER LEFT RIGHT Attribute values are This attribute use to align VERTICALLY is VALIGN MIDDLE TOP BOTTOM Attribute values are The blinking attribute value is the default value for VALIGN. FaaDoOEngineers.com
  • 153. 153 VALIGN=“top” Table Alignment Cell1 Cell2 Cell3 Cell4 Cell5 Cell6 Cell7 Cell8 Cell9 ALIGN=“left” VALIGN=“middle” VALIGN=“bottom” ALIGN=“center” ALIGN=“right” FaaDoOEngineers.com
  • 155. 155 Cascading Style Sheet • Web style sheets are a form of separation of presentation and content for web design . • Style sheet can decide the presentation of web pages. • Style sheet takes care of all the layout, fonts, colors and overall look of the site. FaaDoOEngineers.com
  • 156. 156 Cascading Style Sheet (contd..) • Principal means of Styling a document using Cascading style sheets are: Inline style Sheet External style Sheet Embedded style Sheet FaaDoOEngineers.com
  • 157. 157 Benefits of a Cascading Style Sheet • Pages download faster. • Page contains less code, and the pages are shorter and neater. • The look of the site is kept consistent throughout all the pages that work off the same stylesheet. • Updating the design and general site maintenance are made much easier. FaaDoOEngineers.com
  • 158. 158 Parts of a Cascading Style Sheet • CSS syntax is made up of three parts: Selector Property Value HTML tag that you wish to change The attribute that you wish to change Each property can take a value FaaDoOEngineers.com
  • 159. 159 Inline Style Sheet • Inline style sheets are applied by coding style properties and values inside the tags to which they apply. • An inline style sheet can appear inside any tag to directly set its style. All that is required is to enclose the applicable style properties and values inside a quoted style attribute. • Syntax <tag style=“property:value [;property:value]…”> FaaDoOEngineers.com
  • 160. 160 Inline Style Sheet(contd.) <html> <body> <pre> <h1> Inline Style Sheet</h1> <p style="font-size: 12pt; color: red"> This is line one This is line two This is line three </p> </body> </html> FaaDoOEngineers.com
  • 161. 161 Embedded Style sheet • Embedded style sheets are used when a unique style is required for a document. • Embedded style are defined in the <head> tag section by using the <style> tag • When a large number of style settings are used on a Web page, there is convenience in packaging the settings together in one place as an embedded style sheet, rather than having them scattered as inline style sheets throughout the document. FaaDoOEngineers.com
  • 162. 162 Syntax of Style sheet selector {property: value} Example p {color: green} If the value consist of more than one word the value has to be embedded within quotes. p {font-family: “sans-serif”} If more than one property needs to be defined then the properties need to be separated by semi colon. p {font-family: “sans-serif” ; color: green} FaaDoOEngineers.com
  • 163. 163 Example of an Embedded Style sheet <html> <head> <style type="text/css"> p {font-family:"sans-serif"; color: green} hr {color: red} body {color:blue; background-color:pink} </style> </head> <body> <p>This is paragraph one</p> <hr> <p> This is paragraph two</p> <hr> This line is not within paragraph tag </body> </html> FaaDoOEngineers.com
  • 164. 164 External Style Sheet • Internal style sheets are used when a unique style is required for a document. • Internal style are defined in the <head> tag section by using the <style> tag • The different selectors, their properties and values should be defined within the external style sheet. • The external style sheet should be saved within a file, with an extension of .css FaaDoOEngineers.com
  • 165. 165 External Style sheet Background is defined Paragraph font color is defined Horizontal color is defined Mystyle.css Requires the background, Paragraph and horizontal Rule setting defined In Mystyle.css FirstPage.html SecondPage.html Requires the background, Paragraph and horizontal Rule setting defined In Mystyle.css Both the html files uses <link rel="stylesheet" type="text/css" href=“Mystyle.css" /> FaaDoOEngineers.com
  • 166. 166 Example of External style sheet body {background-color: yellow} h1 {font-size: 36pt} p {margin-left: 50px; background: pink; color:blue} hr {color: red} Mystyle.css <html> <head> <link rel="stylesheet" type="text/css" href="Mystyle.css" /> </head> <body> <h1> This header is 36 pt </h1> <p> This paragraph has a left margin of 50 pixels<br> The font color is blue<br> The background color is pink </p> <hr> </body> </html> MyPage.html FaaDoOEngineers.com
  • 167. 167 Multiple Style sheet h3 { color: red; text-align: left; font-size: 8pt } Mystyle.css <html> <head> <link rel=“stylesheet” type=“text/css” href=“Mystyle.css”> <style type=“text/css”> h3 {font-size: 20pt} </style> </head> <body> <h3> This is a header </h3> ---more text---- </body> </html> MyPage.html What will be the Font size Of <h3> 8pt or 20 pt?? FaaDoOEngineers.com
  • 168. 168 Multiple Style sheet Continued • If some properties have been set for the same selector in different style sheets, the values will be inherited from the more specific style sheet . h3 { color: red; text-align: left; font-size: 8pt } Mystyle.css <html> <head> <link rel=“stylesheet” type=“text/css” href=“Mystyle.css”> <style type=“text/css”> h3 {font-size: 20pt} </style> </head> <body> <h3> This is a header </h3> ---more text---- </body> </html> MyPage.html Color: Red Text-align-left Font-size- 20pt Font Size will be Inherited From the Internal Style sheet FaaDoOEngineers.com
  • 169. 169 Some common selectors and attributes Selector property H1,H2,H3….. font-size,Font-family,font-style , font-weight Color, margin P font-size,Font-family,font-style , font-weight Color, Background-color,text-align, margin HR color body Background-color, font-size,Font-family,font-style , font- weight, margin FaaDoOEngineers.com
  • 170. 170 Class Selector • With the class selector you can define different styles for the same type of HTML element. <html> <head> <link rel=“stylesheet” type=“text/css” href=“Mystyle.css”> </head> <body> <p class=“one”>This paragraph is Right aligned </p> <p class=“two”>This paragraph is Left aligned</p> </body> </html> MyPage.html p.one {text-align: right; color: white; background-color: black} p.two {text-align: left; color: black; background-color: Red} Mystyle.css FaaDoOEngineers.com
  • 171. 171 Uses of <DIV> Tag 1. <DIV> tag is a container for other tags. 2. DIV elements are block elements and work behind the scenes grouping other tags together. Some of the attributes of <DIV> tag are: -> id -> width -> height -> title -> style <DIV> tag FaaDoOEngineers.com
  • 172. 172 Uses of <DIV> Tag <div id="menu" align="right"> <a href="">HOME</a> | <a href="">CONTACT</a> | <a href="">ABOUT</a> | <a href="">LINKS</a></div> <div id="content" align="left" > <h5>Content Articles</h5> <p>This paragraph would be your content paragraph with all of your readable material.</p> <h5 >Content Article Number Two</h5> <p>Here's another content article right here.</p> </div> Example <DIV> tag FaaDoOEngineers.com
  • 173. 173 Uses of <DIV> Tag Output <DIV> tag FaaDoOEngineers.com
  • 174. 174 Using <span> in CSS • SPAN is a inline tag. • It is used to format small chunks of data within another element. • Combining <span> tag with CSS allows us to create custom tags. What is the Utility of <span> in HTML FaaDoOEngineers.com
  • 175. 175 Using <span> in CSS (contd.) p { color: white ; background-color: black} .example1 {color:blue ; background- color: yellow ;font-family: "sans- serif"} .example2 {color:red ; background- color: white ;font-family: times} Mystyle.css <html> <head> <link rel="stylesheet" type="text/css" href="Mystyle.css" /> </head> <body> <p > This is the first line of the paragraph<br> This is the second line of the paragraph<br> <span class="example1">This is the third line of the paragraph<br> </span> <span class="example2">This is the fourth line of the paragraph<br> </span> This is the fifth line of the paragraph </p> </body> </html> MyPage.html FaaDoOEngineers.com
  • 177. 177 Form • An HTML form is a section of a document containing normal content, markup, special elements called controls (checkboxes, radio buttons, menus, etc.), and labels on those controls. • Users generally "complete" a form by modifying its controls (entering text, selecting menu items, etc.), before submitting the form to an agent for processing (e.g., to a Web server, to a mail server, etc.) FaaDoOEngineers.com
  • 178. 178 Form (Contd.) • A form is defined with the <form> tag. FaaDoOEngineers.com
  • 179. 179 Form Controls • TextField:  Are used to accept user input. It is a single line input control. • CheckBox  Checkboxes are used when you want the user to select one or more options of a limited number of choices. • RadioButton  Radio Buttons are used when you want the user to select one of a limited number of choices. • Select  Are used when you want users to choose options from a selectable lists. • TextArea  Are used to accept user input. TextArea allows entry of multiple lines. FaaDoOEngineers.com
  • 180. 180 Form Controls (Contd.) • PushButton  Each push button may have client side script associated with the element's event attributes. When an event occurs (e.g., the user presses the button, releases it, etc.), the associated script is triggered. • Submit Button  When activated, a submit button submits a form. A form may contain more than one submit button. • Reset Button  When activated, a reset button resets all controls to their initial values. FaaDoOEngineers.com
  • 181. 181 Form Controls (Contd) Form Component Tag Usage Output TextField <input> type name value <input type="text" name="t1" value="Paul"> Checkbox <input> type name value <input type="checkbox" name="c1" value="v1"> RadioButton <input> type name value <input type="radio" name="r1" value="v2"> <select> name <option> value TextArea <textarea> row col name <textarea name="n1" row="5" col="20"> <input> type name value <input type="button" name="b1" value="Click"> <input type="submit" name="s1" value="Submit"> <input type="reset" value="Reset"> PushButton Attribute ComboBox <select name="s1"><option value="v1">Display item</option></select> Paul Select anitem Click Submit Reset FaaDoOEngineers.com
  • 182. 182 Form Controls using Attributes: INPUT Attribute definitions • type = text|password|checkbox|radio|submit|reset|file|hidden|image|button  This attribute specifies the „type of control‟ to create. The default value for this attribute is "text". • name = cdata  This attribute assigns the „control name‟. • value = cdata  This attribute specifies the „initial value‟ of the control. It is optional except when the „type’ attribute has the value "radio" or "checkbox". • size = cdata  This attribute tells the initial width of the control. The width is given in pixels except when „type’ attribute has the value "text" or "password". In that case, its value refers to the (integer) number of characters. FaaDoOEngineers.com
  • 183. 183 Form Controls using Attributes: INPUT Attribute definitions (Contd …) • maxlength = number  When the „type’ attribute has the value "text" or "password", this attribute specifies the maximum number of characters the user may enter. This number may exceed the specified „size’, in which case the user should offer a scrolling mechanism. The default value for this attribute is an unlimited number. • Checked  When the „type’ attribute has the value "radio" or "checkbox", this boolean attribute specifies that the button is on. • src = uri  When the „type’ attribute has the value "image", this attribute specifies the location of the image to be used to decorate the graphical submit button. FaaDoOEngineers.com
  • 184. 184 Form Controls using Attributes: SELECT Attribute definitions • name = cdata This attribute assigns the control name. • size = number If a SELECT element is presented as a scrolled list box, this attribute specifies the number of rows in the list that should be visible at the same time. • Multiple If set, this boolean attribute allows multiple selections. If not set, the SELECT element only permits single selections. FaaDoOEngineers.com
  • 185. 185 Pre – Selected Options: • Zero or more choices may be pre-selected for the user. Users should determine which choices are pre-selected as follows:  If no „OPTION‟ element has the „selected‟ attribute set, the initial state has the first option selected.  If one „OPTION‟ element has the „selected‟ attribute set, it should be pre-selected.  If the „SELECT‟ element has the „multiple‟ attribute set and more than one „OPTION‟ element has the „selected‟ attribute set, they should all be pre-selected.  It is considered an error if more than one „OPTION‟ element has the „selected‟ attribute set and the „SELECT‟ element does not have the „multiple‟ attribute set. FaaDoOEngineers.com
  • 186. 186 Example of a Form <html> <head> <title> Form Example</title> </head> <body bgcolor=pink > <center> <h3> Data Entry Form</h3> <form> <table> <tr><td>Name</td><td> <input type="text" name="t1"> </td></tr> <tr><td>Gender</td><td> <input type="radio" name=“r1” value=“m”> Male <input type="radio" name=“r1” value=“f”>Female</td></tr> <tr><td>Qualification</td><td><select name=“s”> <option >Select</option> <option value=“M.Sc”>M Sc</option> <option value=“M.A.”>MA</option> <option value="other">other</option></select > </td></tr> <tr><td> <input type="submit" value="submit"> </td> <td> <input type="reset" value="reset"> </td></tr> </table> </center> </form> </body> </html> FaaDoOEngineers.com
  • 187. 187 Output of the Form FaaDoOEngineers.com
  • 188. 188 Fieldset & Legend Tag • The fieldset tag is used to group the form elements whilst the legend tag provides a label for the fieldset. • The HTML legend tag is used for labelling the fieldset element. • By using the fieldset tag and the legend tag, you can make your forms much easier to understand for your users. FaaDoOEngineers.com
  • 190. 190 Code Snippet <html> <body> <fieldset style="text-align:right;"> <legend><b>Address Details</b></legend> Favorite Address <input type="text" /><br/> Least Favorite Address <input type="text" /><br/> Current Address <input type="text" /><br/> Your Next Address <input type="text" /><br/> </fieldset> <br> <fieldset align="left"> <legend>Personal Info</legend> Name : <input type="text"> Age : <input type="text"> Gender : <input type="radio" name="r1">Male <input type="radio" name="r1">Female </fieldset> </body> </html> FaaDoOEngineers.com
  • 191. 191 <fieldset> tag is used to group the form elements <html> <body> <fieldset style="text-align:right;"> <legend><b>Address Details</b></legend> Favorite Address <input type="text" /><br/> Least Favorite Address <input type="text" /><br/> Current Address <input type="text" /><br/> Your Next Address <input type="text" /><br/> </fieldset> <br> <fieldset align="left"> <legend>Personal Info</legend> Name : <input type="text"> Age : <input type="text"> Gender : <input type="radio" name="r1">Male <input type="radio" name="r1">Female </fieldset> </body> </html> FaaDoOEngineers.com
  • 192. 192 <legend> tag is used give a suitable label to the group. <html> <body> <fieldset style="text-align:right;"> <legend><b>Address Details</b></legend> Favorite Address <input type="text" /><br/> Least Favorite Address <input type="text" /><br/> Current Address <input type="text" /><br/> Your Next Address <input type="text" /><br/> </fieldset> <br> <fieldset align="left"> <legend>Personal Info</legend> Name : <input type="text"> Age : <input type="text"> Gender : <input type="radio" name="r1">Male <input type="radio" name="r1">Female </fieldset> </body> </html> FaaDoOEngineers.com
  • 193. 193 Given a Label using legend tag Created groups using fieldset tag FaaDoOEngineers.com
  • 194. 194 Summary • HTML is used for publishing web page. • A tag is a reference in an HTML document which describes the style and structure of the document. • <TABLE> with <TR>,<TH>,<TD> tags are used to construct a tabular structure in HTML. • To create a List of items in HTML, tags used are <OL>and <UL>. • Tags that separate from one line to others are <P>, <BR>, <HR>. • It is used to include preformatted text into your HTML document. • <BLOCKQUOTE> tag is used to include indented text in a document. • The purpose of Logical Character Style tags is to convey the basic semantic meaning of a piece of text rather than the absolute appearance. • Physical Character Style tags is used to give your text a different look but exacting look. • <Font> tag is used to change the font size, color and face in a document. FaaDoOEngineers.com
  • 195. 195 Summary (Contd.) • Special characters are those that has a special meaning in HTML and those are not found on English keyboards. • HTML uses the <a> (anchor) tag to create a link to another document. • In Html images are defined by using the <img> tag • The <img> tag is a open tag ( does not have a </img>) • Web style sheets are a form of separation of presentation and content for web design . • CSS syntax is made up of three parts: Selector, property and value • Internal style sheets are used when a unique style is required for a document. • Internal style are defined in the <head> tag section by using the <style> tag FaaDoOEngineers.com
  • 196. 196 Summary (Contd.) • Internal style sheets are used when a unique style is required for a document. • Internal style are defined in the <head> tag section by using the <style> tag • With the class selector you can define different styles for the same type of HTML element • <Span> is a inline tag. • Span is used to format small chunks of data within another element.An HTML form is a section of a document containing normal content, markup, special elements called controls. • Some of the common controls are checkboxes, radio buttons, Textfields, etc. • Fieldset & Legend tags are used for grouping form elements and giving a suitable name to the group respectively. FaaDoOEngineers.com
  • 197. 197 Test Your Understanding 1. Select the correct option for making a hyperlink? a. <a href="http://www.w3schools.com">W3Schools</a> b. <a url="http://www.w3schools.com">W3Schools.com</a> c. <a>http://www.w3schools.com</a> d. <a name="http://www.w3schools.com">W3Schools.com</a> 2. Style Sheet can decide presentation of a web page a. false b. true FaaDoOEngineers.com
  • 198. 198 Test Your Understanding (Contd.) 3. The <style> tag should be embedded within: a. <body> b. <form> c. <head> d. <img> 4. With the _________selector you can define different styles for the same type of HTML element. a. Form b. Button c. Span d. class FaaDoOEngineers.com
  • 199. 199 Test Your Understanding (Contd.) 5. The ___________ attribute of table tag separates text from the cell border a. CELLPADDING b. CELLSPACING c. BORDERSPACING d. TABLESPACING 6. What is the default font size in a web page. a. 1 b. 2 c. 3 d. 5 FaaDoOEngineers.com
  • 200. 200 a. <TR> b. <SPAN> c. <STRONG> d. <FIELDSET> e. <HR> iii. Creates a horizontal rule. iv. Creates a new row in a table v. Used to format small chunks of data. i. Emphasizes the text enclosed within it. ii. Used to group the form elements. Match Group A with B Group A Group B Test Your Understanding (Contd.) FaaDoOEngineers.com
  • 201. 201 References • http://www.pierobon.org/iis/url.htm • http://w3schools.com/html • http://www.ology.org/tilt/cgh/ - Things to consider while developing web page using HTML. • http://www.tizag.com/htmlT • http://www.1stsitefree.com • http://www.quackit.com/html FaaDoOFaaDoOEngineers.com