SlideShare a Scribd company logo
1 of 52
Web-Based Design
(IT210)
chapter 2 / part 1
Introduction to
HTML5
1
LEARNING
OUTCOME
 Understand important components
of HTML5 documents.
 Use HTML5 to create web pages.
 Add images to web pages.
 Create and use hyperlinks to help
users navigate web pages.
 Mark up lists of information.
 Create tables with rows and
columns of data.
2
Introduction
• HTML5: (HyperText Markup
Language 5)
• markup language that specifies
the structure and content of
documents that are displayed in
web browsers.
• HTML5 markup contains text (and
images, graphics, animations,
audios and videos) that
represents the content of a
document and elements that
specify a document’s structure
and meaning.
3
For more information about HTML: www.w3schools.com
First HTML
Example
This first example displays the message
Welcome to HTML! in the browser.
4
The
<!DOCTYPE>
Declaration
HTML documents must
start with: Document Type
Definition (DTD)
- It tells web browsers
what type is the
served code
- Not sensitive to the
letter case
Possible versions: HTML 4.01, XHTML 1.0 (Transitional or
Strict), XHTML 1.1, HTML 5 5
Blank lines
We include blank lines
(lines 2 and 10) to make
our documents easier to
read
• Browser ignores the
blank lines
6
Comments:
<!-- --> Tag
• Comments are
enclosed in <!-- and -->
• Comments can exist
anywhere after
<!doctype html>.
• It used to improve
readability and describe
the content of a
document
• The browser ignores
comments.
7
<html> </html>
Tag
• The <html> tag tells the
browser that this is an
HTML document.
• The <html> tag
represents the root of an
HTML document.
• The <html> tag is the
container for all other
HTML elements (except
for the <!DOCTYPE>
tag).
8
The <head>
Section
- Contains information
that doesn’t show
directly on the viewable
page
- Starts after the <html>
declaration
- Begins with <head>
and ends with </head>
- Contains fixed <title> </title> tag (Why?)
- Can contain some other tags, e.g.:
• <meta>
• <script>
• <link>
• <base>
9
<head>
Section:
1- <title> tag
-defines a title in the
browser toolbar
-provides a title for
the page when it is
added to favourites or
Bookmarks
-displays a title for
the page in search
engine
Note: try to make the title as accurate and meaningful
as possible!
10
<head>
Section:
2- <Meta> tag
- Metadata is data
about data.
- The <meta> tag
provides
(information about
the HTML
document.
11
<head> Section:
2- <Meta> tag
 <meta> tag is used to specify
 character encoding: the most popular character encoding scheme for the web is (UTF-8)
—which helps the browser determine how to render the content
 short description, keywords, author of the document, last modified ..etc..
 control the viewport: The viewport is the user's visible area of a web page. It varies
between the devices
 Two necessary attributes – name & content
<meta charset="UTF-8">
<meta name="description" content="HTML tutorial"/>
<meta name="keywords" content="html, web design, styles"/>
<meta name="author" content=“Nada"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
12
<head> Section:
2- <Meta> tag
• A <meta> viewport element gives the
browser instructions on how to control
the page's dimensions and scaling.
• The width=device-width part sets
the width of the page to follow the
screen-width of the device (which will
vary depending on the device).
• The initial-scale=1.0 part sets the
initial zoom level when the page is
first loaded by the browser.
-Here is an example of a web page
with and without the viewport meta tag:
13
<head> Section:
3- < script > tag
 The <script> element is used to embed scripts into an
HTML document
 Scripts are executed in the client's Web browser
 Scripts can live in the <head> and in the <body>
sections
 Supported client-side scripting languages:
• JavaScript
• VBScript 14
<head> Section:
3- < script > tag
15
<!DOCTYPE HTML>
<html>
<head>
<title>JavaScript Example</title>
<script type="text/javascript">
function sayHello() {
document.write("<p>Hello World!</p>");
}
</script>
</head>
<body>
<script type=
"text/javascript">
sayHello();
</script>
</body>
</html>
<head> Section:
4- < style > tag
16
<html>
<head>
<style type="text/css">
p { font-size: 12pt; line-height: 12pt; }
p:first-letter { font-size: 200%; }
span { text-transform: uppercase; }
</style>
</head>
<body>
<p>Styles demo.<br />
<span>Test uppercase</span>.
</p>
</body>
</html>
<body> Section
17
• The <body> section
describes the viewable
portion of the page
• Starts after the <head>
</head> section
• Begins with <body> and
ends with </body>
The Heading Element
18
<h1> to <h6> Define headers
<h1> defines the largest header
<h6> defines the smallest header
<h1>Heading Level 1</h1>
<h2>Heading Level 2</h2>
<h3>Heading Level 3</h3>
<p> ,<br/> tags
19
o Paragraph Element
(<p>...</p>)tag
o <p> …paragraph goes
here… </p>
o empty space above and
below the paragraph
o line break <br/> tag
o …text goes here <br>
o This starts on a new
line….
Example
<p>Contact<br />
6150 Sennott Square<br />
University of Pittsburgh<br>
Pittsburgh, PA 15260</p>
Text
Formatting
• Text formatting tags modify the text between
the opening tag and the closing tag
• Ex. <b>Hello</b> makes “Hello” bold
20
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body>
<b> Hello#1 </b>
<em> Hello#2 </em>
<i> Hello#3 </i>
<u> Hello#4 </u>
<del> Hello#5 </del>
<sup> Hello#6 </sup>
<sub> Hello#7 </sub>
<pre> Hello#8 </pre>
<blockquote>Hello#9</blockquote>
</body>
</html>
Text Formatting (Example)
Output:
21
Text Formatting (Another Example)
Output:
22
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body>
<h1>Notice</h1>
<p>This is a <em>sample</em> Web page.</p>
<p><pre>Next paragraph:
preformatted.</pre></p>
<h2>More Info</h2>
<p>Specifically, we’re using XHMTL 1.0
transitional.<br />
Next line.</p>
</body>
</html>
Attributes, Links,
Images,
Lists, and Tables
23
- Use <a > (anchor) tag to create a link
- Specifies a hyperlink reference (href) to a file or URL
- Click on a specially marked word or image on a web page
and automatically be jumped to:
 Absolute link (External link)
 Link to other websites
 Ex:
 Relative link (Internal link)
 Link to pages on your own site
 Ex:
 Relative to the current page
 Ex:
Links & Anchor Element <a>
<a href =" ht tp://ya ho o.com " t a r g e t = " _ b l a n k " >Ya ho o </a >
<a href =" index .html" >Ho me</a>
<h2 id="section1">Intro</h2>
<a href="#section1">Goto intro</a> 24
 target="_blank" opens the link in a new window
 target="_self" : Open the link in the current frame.
 Link to an e-mail address:
<a href="http://yahoo.com" target="_blank">Yahoo</a>
<a href="mailto:me@hotmail.com">me@hotmail.com</a>
<a href="http://yahoo.com" target=“ _self ">Yahoo</a>
25
Links & Anchor Element <a>
Links to the Same Document – Example
<h1>Table of Contents</h1>
<p> <a href="#section1"> Introduction </a> <br/>
<a href="#section2">Some background</a> <br/>
<a href="#section3">Project History</a> <br/>
...the rest of the table of contents... </p>
<!-- The document text follows here -->
<h2 id="section1">Introduction</h2>
... Section 1 follows here ...
<h2 id="section2">Some background</h2>
... Section 2 follows here ...
<h3 id="section3 ">Project History</h3>
... Section 3 follows here ...
26
Images:<img> tag
27
 Inserting an image with <img> tag:
 Image attributes:
<img src="url" alt="some_text" width="width" height= "height "
>
src Location of image file (relative or absolute)
alt Substitute text for display (e.g. in text mode)
height Number of pixels of the height
width Number of pixels of the width
border Size of border, 0 for no border
Images:<img> tag
28
 Images in same Folder
 Images in Another Folder
 Image as a Link
<img src="html5.gif" alt="HTML5 icon" width="300" height="300" >
<a href="default.asp">
<img src="html5.gif" alt="HTML5 icon" width="300" height="300"
>
</a>
<img src="imeges/html5.gif" alt="HTML5 icon" width="300"
height="300" >
Lists types:
 Unordered list (ul)
- Bulleted items.
 Ordered list (ol)
- Numbered items.
 Definition List(dl)
-a list of items, with a description of
each item.
Note: Browser inserts a blank line
before & after the list (block-level
element)
29
Ordered Lists: <ol>
Tag
<ol type="1">
<li>Apple</li>
<li>Orange</li>
<li>Grapefruit</li>
</ol>
Attribute values for type
are:
1, A, a, I, or I
Note: 1 is the default value
30
a. Apple
b. Orange
c. Grapefruit
1. Apple
2. Orange
3. Grapefruit
A. Apple
B. Orange
C. Grapefruit
I. Apple
II. Orange
III. Grapefrui
t
i. Apple
ii. Orange
iii. Grapefruit
Unordered Lists: <ul>
Tag
<ul type=" circle ">
<li>Apple</li>
<li>Orange</li>
<li>Grapefruit</li>
</ul>
Attribute values for type
are:
disc, circle and square
Note: square is the default value
31
 Apple
 Orange
 Pear
• Apple
• Orange
• Pear
o Apple
o Orange
o Pear
Definition lists: <dl>
tag
<dl>
<dt>HTML</dt>
<dd>A markup language ..</dd>
<dt>CSS</dt>
<dd>Language used to … </dd>
</dl>
32
o Create definition lists using
<dl>
 Pairs of text and associated
definition;
 text is in <dt> tag (defines text),
definition in <dd> tag (definition
descriptions)
 Renders without bullets
 Definition is indented
HTML Special Characters
33
£
&pound;
British Pound
€
&#8364;
Euro
"
&quot;
Quotation Mark
¥
&yen;
Japanese Yen
—
&mdash;
Em Dash
&nbsp;
Non-breaking Space
&
&amp;
Ampersand
>
&gt;
Greater Than
>
&lt;
Less Than
™
&trade;
Trademark Sign
®
&reg;
Registered Trademark Sign
©
&copy;
Copyright Sign
Symbol
HTML Entity
Symbol Name
Tables
- Tables are frequently used
to organize data into rows
and columns.
- <table> element defines an
HTML5 table.
- <caption> element specifies
a table’s title.
34
Tables
A table can be split into three distinct
sections:
1. <thead> Declare the Table Head
• Table titles
• Column headers
2. <tbody> Declare the Table Body .
• Primary table data
3. <tfoot> Declare the table footer
• Calculation results
• Footnotes
Note: Even if the tfoot section in the code
was before the tbody, the tfoot content will
display at the bottom in the table.
- Same applies on thead it always comes on
the top of the table 35
Tables
36
Elemen
t
Definition
<tr> Defines individual table rows
<th> Defines a header cell
<td> Contains table data elements.
<tr>
<tr>
<th> <th>
<td> <td>
Table with Header & Border
<table border="1" >
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
</table>
Tables without Header & Borders
<table border="0" >
<tr>
<td>row 1, cell 1</td>
<td>row 2 , cell 2</td>
</tr>
<tr>
<td> row 2, cell 1 </td>
<td> row 2, cell 2 </td>
</tr>
</table>
Tables
37
row 1, cell 1 row 1, cell 2
row 2, cell 1 row 2, cell 2
38
Tables in summary
Table
-
Example
39
Table
–
Example
cont..
40
Table
–
Example
cont..
41
• Tables have two attributes related to space:
 cellpadding
 Defines the empty
space around the cell
content
 cellspacing
 Defines the empty
space between cells
cell cell
cell cell
cell
cell
cell
cell
Cell Spacing and Padding
42
Cell Spacing and Padding-
Example
43
<table cellspacing="15" cellpadding="0">
<tr>
<td>First</td>
<td>Second</td>
</tr>
</table>
<br/>
<table cellspacing="0" cellpadding="10">
<tr>
<td>First</td>
<td>Second</td>
</tr>
</table>
Row and Column Spans
• You can MERGE data cells with the rowspan and
colspan attributes
• The values of this attributes specify the number of
rows or columns occupied by the cell.
• Can be placed inside any data cell or table header
cell.
44
 rowspan
 Defines how many rows
the cell occupies
 colspan
 Defines how many
columns the cell
occupies
Row and Column Spans
45
cell[1,1] cell[1,2]
cell[2,1]
colspan="1"
colspan="1"
colspan="2"
cell[1,1]
cell[1,2]
cell[2,1]
rowspan="2" rowspan="1"
Row and
Column
Spans -
Example
<table cellspacing="0">
<tr>
<td>Cell[1,1] </td>
<td colspan="2">Cell[2,1]</td>
</tr>
<tr>
< td >Cell[1,2]</td>
<td rowspan="2">Cell[2,2]</td>
< td >Cell[3,2]</td>
</tr>
<tr>
<td>Cell[1,3]</td>
<td>Cell[2,3]</td>
</tr>
</table> 46
Could you predict
the output ?
Cell[2,3]
Cell[1,3]
Cell[3,2]
Cell[2,2]
Cell[1,2]
Cell[2,1]
Cell[1,1]
Using<div>& <span>
block&inline elements
47
Block and Inline Elements
 Block elements:
 Add a line break before and after them
 Define a complete section or block of text
 Ex: <div>, <h1> , <h6>, <p>, <form>,< ul>, <ol>, <li>,
<table>, <tr>, <th> <nav>
 Inline elements
 Define the structure of a sequence of characters within
a line
 Ex: <span>, <a>, <img> 48
The <div> Tag
 <div> creates logical divisions within area of a web page
 create a separate area
 Block display with empty space above and below the div
49
<div style="backgroundcolor:black;color:white;padding:20px;">
<h2>London</h2>
<p>London is the capital city of England...</p>
<p>Standing on the River Thames, London has...</p>
</div>
The <span> Tag
 <span> Inline style element
 Used for modifying a specific portion of text
 Don't create a separate area
 <span> used both style and class attributes with CSS
50
<h1> My <span style="color:red">Important</span> Heading</h1>
The <nav> Tag
 The <nav> tag defines a set of navigation links.
 Notice that NOT all links of a document should be inside a
<nav> element.
 The <nav> element is intended only for major block of
navigation links.
51
To Explore .. (Self driven learning activity).
 Using Google search, find out how to add video from
online resource (E.g YouTube) to html page
 Find out how to add map (Google MAP) to the web
page
52

More Related Content

Similar to Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv

Similar to Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv (20)

Html
HtmlHtml
Html
 
HTML Fundamentals
HTML FundamentalsHTML Fundamentals
HTML Fundamentals
 
3 1-html-fundamentals-110302100520-phpapp02
3 1-html-fundamentals-110302100520-phpapp023 1-html-fundamentals-110302100520-phpapp02
3 1-html-fundamentals-110302100520-phpapp02
 
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
 
PHP HTML CSS Notes
PHP HTML CSS  NotesPHP HTML CSS  Notes
PHP HTML CSS Notes
 
Html Workshop
Html WorkshopHtml Workshop
Html Workshop
 
Html5 css3
Html5 css3Html5 css3
Html5 css3
 
gdsc-html-ppt.pptx
gdsc-html-ppt.pptxgdsc-html-ppt.pptx
gdsc-html-ppt.pptx
 
Intr to-html-xhtml-1233508169541646-3
Intr to-html-xhtml-1233508169541646-3Intr to-html-xhtml-1233508169541646-3
Intr to-html-xhtml-1233508169541646-3
 
HTML 5
HTML 5HTML 5
HTML 5
 
Html
HtmlHtml
Html
 
HTML by Telerik Akademy
HTML by Telerik AkademyHTML by Telerik Akademy
HTML by Telerik Akademy
 
Html
HtmlHtml
Html
 
Introduction to HTML.pptx
Introduction to HTML.pptxIntroduction to HTML.pptx
Introduction to HTML.pptx
 
HTML
HTMLHTML
HTML
 
Introduction to Html
Introduction to HtmlIntroduction to Html
Introduction to Html
 
Session ii(html)
Session ii(html)Session ii(html)
Session ii(html)
 
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART I.pdf
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART I.pdfHSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART I.pdf
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART I.pdf
 
Html basics
Html basicsHtml basics
Html basics
 
HTML practical file
HTML practical fileHTML practical file
HTML practical file
 

More from ZahouAmel1

2- lec_2.pptxDesigning with Type, SpacingDesigning with Type, SpacingDesignin...
2- lec_2.pptxDesigning with Type, SpacingDesigning with Type, SpacingDesignin...2- lec_2.pptxDesigning with Type, SpacingDesigning with Type, SpacingDesignin...
2- lec_2.pptxDesigning with Type, SpacingDesigning with Type, SpacingDesignin...ZahouAmel1
 
1-Lect_1.pptxLecture 5 array in PHP.pptx
1-Lect_1.pptxLecture 5 array in PHP.pptx1-Lect_1.pptxLecture 5 array in PHP.pptx
1-Lect_1.pptxLecture 5 array in PHP.pptxZahouAmel1
 
Lecture 8 PHP and MYSQL part 2.ppType Classificationtx
Lecture 8 PHP and MYSQL part 2.ppType ClassificationtxLecture 8 PHP and MYSQL part 2.ppType Classificationtx
Lecture 8 PHP and MYSQL part 2.ppType ClassificationtxZahouAmel1
 
Lecture 9 CSS part 1.pptxType Classification
Lecture 9 CSS part 1.pptxType ClassificationLecture 9 CSS part 1.pptxType Classification
Lecture 9 CSS part 1.pptxType ClassificationZahouAmel1
 
Lecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvZahouAmel1
 
Lecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 10 CSS part 2.pptxvvvvvvvvvvvvvvZahouAmel1
 
Lec 1 Introduction to Computer and Information Technology #1.pptx
Lec 1 Introduction to Computer and Information Technology #1.pptxLec 1 Introduction to Computer and Information Technology #1.pptx
Lec 1 Introduction to Computer and Information Technology #1.pptxZahouAmel1
 
DB-Lec1.pptxUpdatedpython.pptxUpdatedpython.pptx
DB-Lec1.pptxUpdatedpython.pptxUpdatedpython.pptxDB-Lec1.pptxUpdatedpython.pptxUpdatedpython.pptx
DB-Lec1.pptxUpdatedpython.pptxUpdatedpython.pptxZahouAmel1
 
DB- lec2.pptxUpdatedpython.pptxUpdatedpy
DB- lec2.pptxUpdatedpython.pptxUpdatedpyDB- lec2.pptxUpdatedpython.pptxUpdatedpy
DB- lec2.pptxUpdatedpython.pptxUpdatedpyZahouAmel1
 
Updatedpython.pptxUpdatedpython.pptxUpdatedpython.pptx
Updatedpython.pptxUpdatedpython.pptxUpdatedpython.pptxUpdatedpython.pptxUpdatedpython.pptxUpdatedpython.pptx
Updatedpython.pptxUpdatedpython.pptxUpdatedpython.pptxZahouAmel1
 
4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx
4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx
4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptxZahouAmel1
 
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols
5-LEC- 5.pptxTransport Layer. Transport Layer ProtocolsZahouAmel1
 
6-LEC- 6.pptx Network Layer. Addressing Subnetting Mask (default and subnet) ...
6-LEC- 6.pptx Network Layer. Addressing Subnetting Mask (default and subnet) ...6-LEC- 6.pptx Network Layer. Addressing Subnetting Mask (default and subnet) ...
6-LEC- 6.pptx Network Layer. Addressing Subnetting Mask (default and subnet) ...ZahouAmel1
 
7-Lect_7 .pptxNetwork Layer. Addressing Subnetting Mask (default and subnet) ...
7-Lect_7 .pptxNetwork Layer. Addressing Subnetting Mask (default and subnet) ...7-Lect_7 .pptxNetwork Layer. Addressing Subnetting Mask (default and subnet) ...
7-Lect_7 .pptxNetwork Layer. Addressing Subnetting Mask (default and subnet) ...ZahouAmel1
 
7-Lect_7 .pptxNetwork LayerNetwork Layer
7-Lect_7 .pptxNetwork LayerNetwork Layer7-Lect_7 .pptxNetwork LayerNetwork Layer
7-Lect_7 .pptxNetwork LayerNetwork LayerZahouAmel1
 
8-Lect_8 Addressing the Network.tcp.pptx
8-Lect_8 Addressing the Network.tcp.pptx8-Lect_8 Addressing the Network.tcp.pptx
8-Lect_8 Addressing the Network.tcp.pptxZahouAmel1
 
9-Lect_9-1.pptx9-Lect_9-1.pptx9-Lect_9-1.pptx
9-Lect_9-1.pptx9-Lect_9-1.pptx9-Lect_9-1.pptx9-Lect_9-1.pptx9-Lect_9-1.pptx9-Lect_9-1.pptx
9-Lect_9-1.pptx9-Lect_9-1.pptx9-Lect_9-1.pptxZahouAmel1
 
9-Lect_9-2.pptx DataLink Layer DataLink Layer
9-Lect_9-2.pptx DataLink Layer DataLink Layer9-Lect_9-2.pptx DataLink Layer DataLink Layer
9-Lect_9-2.pptx DataLink Layer DataLink LayerZahouAmel1
 

More from ZahouAmel1 (18)

2- lec_2.pptxDesigning with Type, SpacingDesigning with Type, SpacingDesignin...
2- lec_2.pptxDesigning with Type, SpacingDesigning with Type, SpacingDesignin...2- lec_2.pptxDesigning with Type, SpacingDesigning with Type, SpacingDesignin...
2- lec_2.pptxDesigning with Type, SpacingDesigning with Type, SpacingDesignin...
 
1-Lect_1.pptxLecture 5 array in PHP.pptx
1-Lect_1.pptxLecture 5 array in PHP.pptx1-Lect_1.pptxLecture 5 array in PHP.pptx
1-Lect_1.pptxLecture 5 array in PHP.pptx
 
Lecture 8 PHP and MYSQL part 2.ppType Classificationtx
Lecture 8 PHP and MYSQL part 2.ppType ClassificationtxLecture 8 PHP and MYSQL part 2.ppType Classificationtx
Lecture 8 PHP and MYSQL part 2.ppType Classificationtx
 
Lecture 9 CSS part 1.pptxType Classification
Lecture 9 CSS part 1.pptxType ClassificationLecture 9 CSS part 1.pptxType Classification
Lecture 9 CSS part 1.pptxType Classification
 
Lecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
 
Lecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
 
Lec 1 Introduction to Computer and Information Technology #1.pptx
Lec 1 Introduction to Computer and Information Technology #1.pptxLec 1 Introduction to Computer and Information Technology #1.pptx
Lec 1 Introduction to Computer and Information Technology #1.pptx
 
DB-Lec1.pptxUpdatedpython.pptxUpdatedpython.pptx
DB-Lec1.pptxUpdatedpython.pptxUpdatedpython.pptxDB-Lec1.pptxUpdatedpython.pptxUpdatedpython.pptx
DB-Lec1.pptxUpdatedpython.pptxUpdatedpython.pptx
 
DB- lec2.pptxUpdatedpython.pptxUpdatedpy
DB- lec2.pptxUpdatedpython.pptxUpdatedpyDB- lec2.pptxUpdatedpython.pptxUpdatedpy
DB- lec2.pptxUpdatedpython.pptxUpdatedpy
 
Updatedpython.pptxUpdatedpython.pptxUpdatedpython.pptx
Updatedpython.pptxUpdatedpython.pptxUpdatedpython.pptxUpdatedpython.pptxUpdatedpython.pptxUpdatedpython.pptx
Updatedpython.pptxUpdatedpython.pptxUpdatedpython.pptx
 
4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx
4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx
4-Lect_4-2.pptx4-Lect_4-2.pptx4-Lect_4-2.pptx
 
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
 
6-LEC- 6.pptx Network Layer. Addressing Subnetting Mask (default and subnet) ...
6-LEC- 6.pptx Network Layer. Addressing Subnetting Mask (default and subnet) ...6-LEC- 6.pptx Network Layer. Addressing Subnetting Mask (default and subnet) ...
6-LEC- 6.pptx Network Layer. Addressing Subnetting Mask (default and subnet) ...
 
7-Lect_7 .pptxNetwork Layer. Addressing Subnetting Mask (default and subnet) ...
7-Lect_7 .pptxNetwork Layer. Addressing Subnetting Mask (default and subnet) ...7-Lect_7 .pptxNetwork Layer. Addressing Subnetting Mask (default and subnet) ...
7-Lect_7 .pptxNetwork Layer. Addressing Subnetting Mask (default and subnet) ...
 
7-Lect_7 .pptxNetwork LayerNetwork Layer
7-Lect_7 .pptxNetwork LayerNetwork Layer7-Lect_7 .pptxNetwork LayerNetwork Layer
7-Lect_7 .pptxNetwork LayerNetwork Layer
 
8-Lect_8 Addressing the Network.tcp.pptx
8-Lect_8 Addressing the Network.tcp.pptx8-Lect_8 Addressing the Network.tcp.pptx
8-Lect_8 Addressing the Network.tcp.pptx
 
9-Lect_9-1.pptx9-Lect_9-1.pptx9-Lect_9-1.pptx
9-Lect_9-1.pptx9-Lect_9-1.pptx9-Lect_9-1.pptx9-Lect_9-1.pptx9-Lect_9-1.pptx9-Lect_9-1.pptx
9-Lect_9-1.pptx9-Lect_9-1.pptx9-Lect_9-1.pptx
 
9-Lect_9-2.pptx DataLink Layer DataLink Layer
9-Lect_9-2.pptx DataLink Layer DataLink Layer9-Lect_9-2.pptx DataLink Layer DataLink Layer
9-Lect_9-2.pptx DataLink Layer DataLink Layer
 

Recently uploaded

Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxsqpmdrvczh
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........LeaCamillePacle
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 

Recently uploaded (20)

Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptx
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 

Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv

  • 1. Web-Based Design (IT210) chapter 2 / part 1 Introduction to HTML5 1
  • 2. LEARNING OUTCOME  Understand important components of HTML5 documents.  Use HTML5 to create web pages.  Add images to web pages.  Create and use hyperlinks to help users navigate web pages.  Mark up lists of information.  Create tables with rows and columns of data. 2
  • 3. Introduction • HTML5: (HyperText Markup Language 5) • markup language that specifies the structure and content of documents that are displayed in web browsers. • HTML5 markup contains text (and images, graphics, animations, audios and videos) that represents the content of a document and elements that specify a document’s structure and meaning. 3 For more information about HTML: www.w3schools.com
  • 4. First HTML Example This first example displays the message Welcome to HTML! in the browser. 4
  • 5. The <!DOCTYPE> Declaration HTML documents must start with: Document Type Definition (DTD) - It tells web browsers what type is the served code - Not sensitive to the letter case Possible versions: HTML 4.01, XHTML 1.0 (Transitional or Strict), XHTML 1.1, HTML 5 5
  • 6. Blank lines We include blank lines (lines 2 and 10) to make our documents easier to read • Browser ignores the blank lines 6
  • 7. Comments: <!-- --> Tag • Comments are enclosed in <!-- and --> • Comments can exist anywhere after <!doctype html>. • It used to improve readability and describe the content of a document • The browser ignores comments. 7
  • 8. <html> </html> Tag • The <html> tag tells the browser that this is an HTML document. • The <html> tag represents the root of an HTML document. • The <html> tag is the container for all other HTML elements (except for the <!DOCTYPE> tag). 8
  • 9. The <head> Section - Contains information that doesn’t show directly on the viewable page - Starts after the <html> declaration - Begins with <head> and ends with </head> - Contains fixed <title> </title> tag (Why?) - Can contain some other tags, e.g.: • <meta> • <script> • <link> • <base> 9
  • 10. <head> Section: 1- <title> tag -defines a title in the browser toolbar -provides a title for the page when it is added to favourites or Bookmarks -displays a title for the page in search engine Note: try to make the title as accurate and meaningful as possible! 10
  • 11. <head> Section: 2- <Meta> tag - Metadata is data about data. - The <meta> tag provides (information about the HTML document. 11
  • 12. <head> Section: 2- <Meta> tag  <meta> tag is used to specify  character encoding: the most popular character encoding scheme for the web is (UTF-8) —which helps the browser determine how to render the content  short description, keywords, author of the document, last modified ..etc..  control the viewport: The viewport is the user's visible area of a web page. It varies between the devices  Two necessary attributes – name & content <meta charset="UTF-8"> <meta name="description" content="HTML tutorial"/> <meta name="keywords" content="html, web design, styles"/> <meta name="author" content=“Nada"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"> 12
  • 13. <head> Section: 2- <Meta> tag • A <meta> viewport element gives the browser instructions on how to control the page's dimensions and scaling. • The width=device-width part sets the width of the page to follow the screen-width of the device (which will vary depending on the device). • The initial-scale=1.0 part sets the initial zoom level when the page is first loaded by the browser. -Here is an example of a web page with and without the viewport meta tag: 13
  • 14. <head> Section: 3- < script > tag  The <script> element is used to embed scripts into an HTML document  Scripts are executed in the client's Web browser  Scripts can live in the <head> and in the <body> sections  Supported client-side scripting languages: • JavaScript • VBScript 14
  • 15. <head> Section: 3- < script > tag 15 <!DOCTYPE HTML> <html> <head> <title>JavaScript Example</title> <script type="text/javascript"> function sayHello() { document.write("<p>Hello World!</p>"); } </script> </head> <body> <script type= "text/javascript"> sayHello(); </script> </body> </html>
  • 16. <head> Section: 4- < style > tag 16 <html> <head> <style type="text/css"> p { font-size: 12pt; line-height: 12pt; } p:first-letter { font-size: 200%; } span { text-transform: uppercase; } </style> </head> <body> <p>Styles demo.<br /> <span>Test uppercase</span>. </p> </body> </html>
  • 17. <body> Section 17 • The <body> section describes the viewable portion of the page • Starts after the <head> </head> section • Begins with <body> and ends with </body>
  • 18. The Heading Element 18 <h1> to <h6> Define headers <h1> defines the largest header <h6> defines the smallest header <h1>Heading Level 1</h1> <h2>Heading Level 2</h2> <h3>Heading Level 3</h3>
  • 19. <p> ,<br/> tags 19 o Paragraph Element (<p>...</p>)tag o <p> …paragraph goes here… </p> o empty space above and below the paragraph o line break <br/> tag o …text goes here <br> o This starts on a new line…. Example <p>Contact<br /> 6150 Sennott Square<br /> University of Pittsburgh<br> Pittsburgh, PA 15260</p>
  • 20. Text Formatting • Text formatting tags modify the text between the opening tag and the closing tag • Ex. <b>Hello</b> makes “Hello” bold 20
  • 21. <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <b> Hello#1 </b> <em> Hello#2 </em> <i> Hello#3 </i> <u> Hello#4 </u> <del> Hello#5 </del> <sup> Hello#6 </sup> <sub> Hello#7 </sub> <pre> Hello#8 </pre> <blockquote>Hello#9</blockquote> </body> </html> Text Formatting (Example) Output: 21
  • 22. Text Formatting (Another Example) Output: 22 <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <h1>Notice</h1> <p>This is a <em>sample</em> Web page.</p> <p><pre>Next paragraph: preformatted.</pre></p> <h2>More Info</h2> <p>Specifically, we’re using XHMTL 1.0 transitional.<br /> Next line.</p> </body> </html>
  • 24. - Use <a > (anchor) tag to create a link - Specifies a hyperlink reference (href) to a file or URL - Click on a specially marked word or image on a web page and automatically be jumped to:  Absolute link (External link)  Link to other websites  Ex:  Relative link (Internal link)  Link to pages on your own site  Ex:  Relative to the current page  Ex: Links & Anchor Element <a> <a href =" ht tp://ya ho o.com " t a r g e t = " _ b l a n k " >Ya ho o </a > <a href =" index .html" >Ho me</a> <h2 id="section1">Intro</h2> <a href="#section1">Goto intro</a> 24
  • 25.  target="_blank" opens the link in a new window  target="_self" : Open the link in the current frame.  Link to an e-mail address: <a href="http://yahoo.com" target="_blank">Yahoo</a> <a href="mailto:me@hotmail.com">me@hotmail.com</a> <a href="http://yahoo.com" target=“ _self ">Yahoo</a> 25 Links & Anchor Element <a>
  • 26. Links to the Same Document – Example <h1>Table of Contents</h1> <p> <a href="#section1"> Introduction </a> <br/> <a href="#section2">Some background</a> <br/> <a href="#section3">Project History</a> <br/> ...the rest of the table of contents... </p> <!-- The document text follows here --> <h2 id="section1">Introduction</h2> ... Section 1 follows here ... <h2 id="section2">Some background</h2> ... Section 2 follows here ... <h3 id="section3 ">Project History</h3> ... Section 3 follows here ... 26
  • 27. Images:<img> tag 27  Inserting an image with <img> tag:  Image attributes: <img src="url" alt="some_text" width="width" height= "height " > src Location of image file (relative or absolute) alt Substitute text for display (e.g. in text mode) height Number of pixels of the height width Number of pixels of the width border Size of border, 0 for no border
  • 28. Images:<img> tag 28  Images in same Folder  Images in Another Folder  Image as a Link <img src="html5.gif" alt="HTML5 icon" width="300" height="300" > <a href="default.asp"> <img src="html5.gif" alt="HTML5 icon" width="300" height="300" > </a> <img src="imeges/html5.gif" alt="HTML5 icon" width="300" height="300" >
  • 29. Lists types:  Unordered list (ul) - Bulleted items.  Ordered list (ol) - Numbered items.  Definition List(dl) -a list of items, with a description of each item. Note: Browser inserts a blank line before & after the list (block-level element) 29
  • 30. Ordered Lists: <ol> Tag <ol type="1"> <li>Apple</li> <li>Orange</li> <li>Grapefruit</li> </ol> Attribute values for type are: 1, A, a, I, or I Note: 1 is the default value 30 a. Apple b. Orange c. Grapefruit 1. Apple 2. Orange 3. Grapefruit A. Apple B. Orange C. Grapefruit I. Apple II. Orange III. Grapefrui t i. Apple ii. Orange iii. Grapefruit
  • 31. Unordered Lists: <ul> Tag <ul type=" circle "> <li>Apple</li> <li>Orange</li> <li>Grapefruit</li> </ul> Attribute values for type are: disc, circle and square Note: square is the default value 31  Apple  Orange  Pear • Apple • Orange • Pear o Apple o Orange o Pear
  • 32. Definition lists: <dl> tag <dl> <dt>HTML</dt> <dd>A markup language ..</dd> <dt>CSS</dt> <dd>Language used to … </dd> </dl> 32 o Create definition lists using <dl>  Pairs of text and associated definition;  text is in <dt> tag (defines text), definition in <dd> tag (definition descriptions)  Renders without bullets  Definition is indented
  • 33. HTML Special Characters 33 £ &pound; British Pound € &#8364; Euro " &quot; Quotation Mark ¥ &yen; Japanese Yen — &mdash; Em Dash &nbsp; Non-breaking Space & &amp; Ampersand > &gt; Greater Than > &lt; Less Than ™ &trade; Trademark Sign ® &reg; Registered Trademark Sign © &copy; Copyright Sign Symbol HTML Entity Symbol Name
  • 34. Tables - Tables are frequently used to organize data into rows and columns. - <table> element defines an HTML5 table. - <caption> element specifies a table’s title. 34
  • 35. Tables A table can be split into three distinct sections: 1. <thead> Declare the Table Head • Table titles • Column headers 2. <tbody> Declare the Table Body . • Primary table data 3. <tfoot> Declare the table footer • Calculation results • Footnotes Note: Even if the tfoot section in the code was before the tbody, the tfoot content will display at the bottom in the table. - Same applies on thead it always comes on the top of the table 35
  • 36. Tables 36 Elemen t Definition <tr> Defines individual table rows <th> Defines a header cell <td> Contains table data elements. <tr> <tr> <th> <th> <td> <td>
  • 37. Table with Header & Border <table border="1" > <tr> <th>Header 1</th> <th>Header 2</th> </tr> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> </table> Tables without Header & Borders <table border="0" > <tr> <td>row 1, cell 1</td> <td>row 2 , cell 2</td> </tr> <tr> <td> row 2, cell 1 </td> <td> row 2, cell 2 </td> </tr> </table> Tables 37 row 1, cell 1 row 1, cell 2 row 2, cell 1 row 2, cell 2
  • 42. • Tables have two attributes related to space:  cellpadding  Defines the empty space around the cell content  cellspacing  Defines the empty space between cells cell cell cell cell cell cell cell cell Cell Spacing and Padding 42
  • 43. Cell Spacing and Padding- Example 43 <table cellspacing="15" cellpadding="0"> <tr> <td>First</td> <td>Second</td> </tr> </table> <br/> <table cellspacing="0" cellpadding="10"> <tr> <td>First</td> <td>Second</td> </tr> </table>
  • 44. Row and Column Spans • You can MERGE data cells with the rowspan and colspan attributes • The values of this attributes specify the number of rows or columns occupied by the cell. • Can be placed inside any data cell or table header cell. 44
  • 45.  rowspan  Defines how many rows the cell occupies  colspan  Defines how many columns the cell occupies Row and Column Spans 45 cell[1,1] cell[1,2] cell[2,1] colspan="1" colspan="1" colspan="2" cell[1,1] cell[1,2] cell[2,1] rowspan="2" rowspan="1"
  • 46. Row and Column Spans - Example <table cellspacing="0"> <tr> <td>Cell[1,1] </td> <td colspan="2">Cell[2,1]</td> </tr> <tr> < td >Cell[1,2]</td> <td rowspan="2">Cell[2,2]</td> < td >Cell[3,2]</td> </tr> <tr> <td>Cell[1,3]</td> <td>Cell[2,3]</td> </tr> </table> 46 Could you predict the output ? Cell[2,3] Cell[1,3] Cell[3,2] Cell[2,2] Cell[1,2] Cell[2,1] Cell[1,1]
  • 48. Block and Inline Elements  Block elements:  Add a line break before and after them  Define a complete section or block of text  Ex: <div>, <h1> , <h6>, <p>, <form>,< ul>, <ol>, <li>, <table>, <tr>, <th> <nav>  Inline elements  Define the structure of a sequence of characters within a line  Ex: <span>, <a>, <img> 48
  • 49. The <div> Tag  <div> creates logical divisions within area of a web page  create a separate area  Block display with empty space above and below the div 49 <div style="backgroundcolor:black;color:white;padding:20px;"> <h2>London</h2> <p>London is the capital city of England...</p> <p>Standing on the River Thames, London has...</p> </div>
  • 50. The <span> Tag  <span> Inline style element  Used for modifying a specific portion of text  Don't create a separate area  <span> used both style and class attributes with CSS 50 <h1> My <span style="color:red">Important</span> Heading</h1>
  • 51. The <nav> Tag  The <nav> tag defines a set of navigation links.  Notice that NOT all links of a document should be inside a <nav> element.  The <nav> element is intended only for major block of navigation links. 51
  • 52. To Explore .. (Self driven learning activity).  Using Google search, find out how to add video from online resource (E.g YouTube) to html page  Find out how to add map (Google MAP) to the web page 52

Editor's Notes

  1. 07/16/96
  2. <div width=“100%”> <iframe width="100%" height="600" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?width=100%25&amp;height=600&amp;hl=en&amp;q=1%20Grafton%20Street,%20Dublin,%20Ireland+(My%20Business%20Name)&amp;t=&amp;z=14&amp;ie=UTF8&amp;iwloc=B&amp;output=embed"></iframe> </div>