SlideShare a Scribd company logo
RandyRandy ConnollyConnolly andand RicardoRicardo HoarHoar FundamentalsFundamentals ofof
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Textbook to be published by Pearson Ed in early 2
http://www.funwebdev.c
014
o
Fundamentals of Web Development
Randy Connolly and Ricardo Hoar
© 2015 Pearson
http://www.funwebdev.com
HTML 1: Overview
Objectives
HTML Defined
and its History
HTML Syntax
Semantic Markup Structure of
HTML
Quick Tour of
HTML
1
3
5
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
2
4
6 HTML
Semantic Elements
Section 1 of 6
HTML DEFINED + ITS HISTORY
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
• ARPANET (Advanced Research Project Agency
Network)of the late 1960s by U.S DoD
(Department of Defence)
• jump quickly to the first public specification of
the HTML by Tim Berners-Lee in 1991
• HTML’s codification by the World-Wide Web
Consortium (better known as the W3C) in
1997.
• (W3C is the International standards
organization for www . Its task is to develop
protocols and guidelines that ensure long
term growth for the web).
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Brief History of HTML
Did we mention that this will be brief?
HTML is defined as a markup language.
• A markup language is simply a way of annotating a
document in such a way to make the annotations
distinct from the text being annotated.
• The term comes from the days of print, when
editors would write instructions on manuscript
pages that might be revision instructions to the
author or copy editor.
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
HTML Syntax
What is a markup language?
Sample ad hoc markup
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
At its simplest, markup is a way to indicate
information about the content
• This “information about content” in HTML is
implemented via tags (aka elements).
• The markup in the previous slide consists of the red
text and the various circles and arrows on the one
page, and the little yellow sticky notes on the
other.
• HTML does the same thing but uses textual tags.
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Markup
What is it again?
• The W3C is the main standards organization for the
World Wide Web.
• To promotes compatibility the W3C produces
recommendations (also called specifications).
• In 1998, the W3C turned its attention to a new
specification called XHTML 1.0, which was a version of
HTML that used stricter XML (Extensible Markup
Language) syntax rules.
• By 2009, the W3C stopped work on XHTML 2.0 and
instead adopted the HTML5.
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
What is the W3C?
Standards
HTML5 is the latest version of HTML and supports new markup
language functionalities such as multimedia, new tags and elements
as well as new API’s.
There are three main aims to HTML5:
• Specify unambiguously how browsers should deal with invalid
markup.
• Provide an open, non-proprietary programming framework (via
Javascript) for creating rich web applications.
• Be backwards compatible with the existing web.
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
HTML5
Three main aims
• While parts of the HTML5 are still being finalized,
all of the major browser manufacturers have at
least partially embraced HTML5.
• Certainly not all browsers and all versions support
every feature of HTML5.
• This is in fact by design. HTML in HTML5 is now a
living language: that is, it is a language that evolves
and develops over time.
• As such, every browser will support a gradually
increasing subset of HTML5 capabilities
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
HTML5
It evolves
HTML5 Support in Browsers
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Section 2 of 6
HTML SYNTAX
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
HTML documents are composed of textual content
and HTML elements.
An HTML element can contain text, other elements, or
be empty. It is identified in the HTML document by
tags.
HTML elements can also contain attributes. An HTML
attribute is a name=value pair that provides more
information about the HTML element.
In XHTML, attribute values had to be enclosed in
quotes; in HTML5, the quotes are optional.
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Elements and Attributes
More syntax
What HTML lets you do
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
▪ Insert images using the <img> tag
▪ Create links with the <a> tag
▪ Create lists with the <ul>, <ol> and
<li> tags
▪ Create headings with <H1>, <H2>,
…, <H6>
▪ Define metatdata with <meta> tag
▪ And much more…
Elements and Attributes
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Nesting HTML elements
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Often an HTML element will contain other HTML
elements.
In such a case, the container element is said to be a
parent of the contained, or child, element.
Any elements contained within the child are said to be
descendents of the parent element; likewise, any
given child element, may have a variety of ancestors.
Hierarchy of elements
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Nesting HTML elements
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
In order to properly construct a hierarchy of elements,
your browser expects each HTML nested element to
be properly nested.
That is, a child’s ending tag must occur before its
parent’s ending tag.
Section 3 of 6
SEMANTIC MARKUP
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Semantic markup refers to marking up a document
with information about the actual data structure
behind the information, rather than styling the
document with exclusively visual information.
Over the past decade, a strong and broad consensus
has grown around the belief that HTML documents
should only focus on the structure of the document.
Information about how the content should look when
it is displayed in the browser is best left to CSS
(Cascading Style Sheets).
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Semantic Markup
What does it mean?
Semantic Markup
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
As a consequence, beginning HTML authors are often
counseled to create semantic HTML documents.
That is, an HTML document should not describe how
to visually present content, but only describe its
content’s structural semantics or meaning.
Structure
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Structure is a vital way of communicating information
in paper and electronic documents.
All of the tags that we will examine in this
presentation are used to describe the basic structural
information in a document, such as articles, headings,
lists, paragraphs, links, images, navigation, footers,
and so on.
Eliminating presentation-oriented markup and writing
semantic HTML markup has a variety of important
advantages:
Maintainability. Semantic markup is easier to update and
change than web pages that contain a great deal of
presentation markup.
Faster. Semantic web pages are typically quicker to author
and faster to download.
Accessibility. Visiting a web page using voice reading
software can be a very frustrating experience if the site
does not use semantic markup.
Search engine optimization. Semantic markup provides
better instructions for search engines: it tells them what
things are important content on the site.
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Semantic Markup
Its advantages
Section 4 of 6
STRUCTURE OF HTML
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Simplest HTML document
The <title> element (Item ) is used to provide a broad description of the
content. The title is not displayed within the browser window. Instead, the
title is typically displayed by the browser in its window and/or tab.
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
A more complete document
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Tells the browser (or any other client software that is
reading this HTML document) what type of document
it is about to process.
Notice that it does not indicate what version of HTML
is contained within the document: it only specifies
that it contains HTML.
DOCTYPE
(short for Document Type Definition)
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
HTML, Head, and Body
HTML5 does not require the use of the <html>,
<head>, and <body>.
However, in XHTML they were required, and most
web authors continue to use them.
The <html> element is sometimes called the root
element as it contains all the other HTML elements in
the document.
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Head and Body
HTML pages are divided into two sections: the head
and the body, which correspond to the <head> and
<body> elements.
The head contains descriptive elements about the
document
The body contains content that will be displayed by
the browser.
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
You will notice that the <head> element contains a
variety of additional elements.
The first of these is the <meta> element. Our example
declares that the character encoding for the document
is UTF-8. (This covers almost all of the characters and
symbols in the world)
Inside the head
There are no brains
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
UTF-8 is an encoding system for Unicode. UTF stands for
“Unicode Transformation Format”
This encoding system can translate any Unicode character to a matching
Unicode binary string and can also translate the binary string back to a
Unicode character.
What is Unicode?
Unicode is an International character encoding standard that provides a
unique number for every character across languages and scripts, making
almost all characters accessible across platforms , programs and devices.
Unicode is a universal character set that defines all the characters needed
for writing the majority of living languages in use on computers.
Unicode aims to be (and already is) a superset of all other encoded
computer character sets.
The Unicode Standard covers (almost) all characters, punctuations, and
symbols in the world and enables processing, storage, and transport of
text independent of platform and language.
Our example specifies an external CSS style sheet file
that is used with this document.
It also references an external Javascript file.
Inside the head
No brains but metas, styles and javascripts
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Section 5 of 6
QUICK TOUR OF HTML
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Why a quick tour?
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
HTML5 contains many structural and presentation
elements – too many to completely cover in this
presentation.
Rather than comprehensively cover all these
elements, this presentation will provide a quick
overview of the most common elements.
Sample Document
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
HTML provides six levels of
heading (h1, h2, h3, …), with
the higher heading number
indicating a heading of less
importance.
Headings are an essential way
for document authors use to
show their readers the
structure of the document.
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Headings
<h1>, <h2>, <h3>, etc
Headings
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
The browser has its
own default styling for
each heading level.
However, these are
easily modified and
customized via CSS.
In practice, specify a heading level that is semantically
accurate.
Do not choose a heading level because of its default
presentation
• e.g., choosing <h3> because you want your text to
be bold and 16pt
Rather, choose the heading level because it is
appropriate
• e.g., choosing <h3> because it is a third level
heading and not a primary or secondary heading
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Headings
Be semantically accurate
Paragraphs are the most basic unit of text in an HTML
document.
Notice that the <p> tag is a container and can contain
HTML and other inline HTML elements
inline HTML elements refers to HTML elements that
do not cause a paragraph break but are part of the
regular “flow” of the text.
Paragraphs
<p>
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
This <div> tag is also a container element and is used
to create a logical grouping of content
• The <div> element has no intrinsic presentation.
• It is frequently used in contemporary CSS-based
layouts to mark out sections.
Divisions
<div>
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
HTML5 has a variety of new semantic elements (which
we will examine later) that can be used to reduce
somewhat the confusing mass of div within divs within
divs that is so typical of contemporary web design.
Using div elements
Can you say “div-tastic”
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Links are created using the <a> element (the “a”
stands for anchor).
A link has two main parts: the destination and the
label.
Links
<a>
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Types of Links
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
You can use the anchor element to create a wide range of
links:
• Links to external sites (or to individual resources
such as images or movies on an external site).
• Links to other pages or resources within the current
site.
• Links to other places within the current page.
• Links to particular locations on another page.
• Links that are instructions to the browser to start the
user’s email program.
• Links that are instructions to the browser to execute
a Javascript function.
Different link destinations
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Links with the label “Click Here” were once a staple of
the web.
Today, such links are frowned upon, since:
• they do not tell users where the link will take them
• as a verb “click” is becoming increasingly inaccurate
when one takes into account the growth of mobile
browsers.
Instead, textual link labels should be descriptive.
“Click here to see the race results”
“Race Results” or “See Race Results”.
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Link Text
Some guidance … or … don’t “Click Here”
When referencing a page or resource on an external
site, a full absolute reference is required: that is,
• the protocol (typically, http://),
• the domain name,
• any paths, and then finally
• the file name of the desired resource.
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
URL Absolute Referencing
For external resources
We also need to be able to successfully reference files
within our site.
This requires learning the syntax for so-called relative
referencing.
When referencing a resource that is on the same
server as your HTML document, then you can use
briefer relative referencing. If the URL does not
include the “http://” then the browser will request the
current server for the file.
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
URL Relative Referencing
An essential skill
URL Relative Referencing
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
If all the resources for the site reside within the same
directory (also referred to as a folder), then you can
reference those other resources simply via their
filename.
However, most real-world sites contain too many files
to put them all within a single directory.
For these situations, a relative pathname is required
along with the filename.
The pathname tells the browser where to locate the
file on the server.
Pathnames
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Pathnames on the web follow Unix conventions.
• Forward slashes (“/”) are used to separate
directory names from each other and from file
names.
• Double-periods (“..”) are used to reference a
directory “above” the current one in the directory
tree.
URL Relative Referencing
Relative Link Type Example
Same Directory
To link to a file within the same
folder, simply use the file name.
To link toexample.html from
about.html(in Figure 2.18), use:
<a href="example.html">
Child Directory
To link to a file within a subdirectory,
use the name of the subdirectory and
a slash before the file name.
To link tologo.gif from about.html,
use:
<a href="images/logo.gif">
Grandchild/Descendant
Directory
To link to a file that is multiple
subdirectoriesbelow the current one,
construct the full path by including
each subdirectory name (separated
by slashes) before the file name.
To link tobackground.gif from
about.html,use:
<a
href="css/images/background.gif"
>
Parent/Ancestor Directory
Use “../” to reference a folderabove
the current one. If trying to reference
a file several levels above the current
one, simply string together multiple
To link toabout.html fromindex.html
in members,use:
<a href="../about.html">
To link toabout.html frombio.html,
use:
“../”.
<a href="../../about.html">
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
URL Relative Referencing
Sibling Directory
Use “../”to move up to the appropriate
level, and then use the same technique as
for child or grandchild directories.
To link to logo.gif from index.html in
members, use:
<a href="../images/about.html">
To link to background.gif from bio.html, use:
<a
href="../../css/images/background.gif">
Root Reference
An alternative approach for ancestor and
sibling references is to use the so-called
root reference approach. In this approach,
begin the reference with the root reference
(the “/”) and then use the same technique
as for child or grandchild directories. Note
that these will only work on the server!
That is, they will not work when you test it
out on your local machine.
To link to about.html from bio.html, use:
<a href="/about.html">
To link to background.gif from bio.html, use:
<a href="/images/background.gif">
Default Document
Web servers allow references to directory
names without file names. In such a case,
the web server will serve the default
document, which is usually a file called
index.html (apache) or default.html (IIS).
Again, this will only generally work on the
web server.
To link to index.html in members from
about.html, use either:
<a href="members">
Or
<a href="/members">
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Inline elements do not disrupt the flow of text (i.e.,
cause a line break).
HTML5 defines over 30 of these elements.
e.g., <a>, <br>, <em>, <strong>
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Inline Text Elements
Do not disrupt the flow
Images
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
While the <img> tag is the oldest method for
displaying an image, it is not the only way.
For purely decorative images, such as background
gradients and patterns, logos, border art, and so on, it
makes semantic sense to keep such images out of the
markup and in CSS where they more rightly belong.
But when the images are content, such as in the
images in a gallery or the image of a product in a
product details page, then the <img> tag is the
semantically appropriate approach.
Images
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Unordered lists. Collections of items in no particular
order; these are by default rendered by the browser
as a bulleted list.
Ordered lists. Collections of items that have a set
order; these are by default rendered by the browser
as a numbered list.
Definition lists. Collection of name and definition
pairs. These tend to be used infrequently. Perhaps the
most common example would be a FAQ list.
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Lists
HTML provides three types of lists
Lists
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Character Entities
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
These are special characters for symbols for which
there is either no way easy way to type in via a
keyboard (such as the copyright symbol or accented
characters) or which have a reserved meaning in
HTML (for instance the “<” or “>” symbols).
They can be used in an HTML document by using the
entity name or the entity number.
e.g., &nbsp; and &copy;
6th_sem_web_unit1_bahagsgsgwgbapart1.pptx
Section 6 of 6
HTML SEMANTIC ELEMENTS
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
One substantial problem with modern, pre-HTML5
semantic markup:
most complex web sites are absolutely packed solid
with <div> elements.
Unfortunately, all these <div> elements can make the
resulting markup confusing and hard to modify.
Developers typically try to bring some sense and order
to the <div> chaos by using id or class names that
provide some clue as to their meaning.
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
HTML5 Semantic Elements
Why are they needed?
6th_sem_web_unit1_bahagsgsgwgbapart1.pptx
XHTML versus HTML5
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Most web site pages have a recognizable header and
footer section.
Typically the header contains
• the site logo
• title (and perhaps additional subtitles or taglines)
• horizontal navigation links, and
• perhaps one or two horizontal banners.
Header and Footer
<header> <footer>
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
The typical footer contains less important material,
such as
• smaller text versions of the navigation,
• copyright notices,
• information about the site’s privacy policy, and
• perhaps twitter feeds or links to other social sites.
Header and Footer
<header> <footer>
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Header and Footer
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Both the HTML5 <header> and <footer> element can
be used not only for page headers and footers, they
can also be used for header and footer elements
within other HTML5 containers, such as <article> or
<section>.
<header>
<img src="logo.gif" alt="logo" />
<h1>Fundamentals of Web Development</h1>
...
</header>
<article>
<header>
<h2>HTML5 Semantic Structure Elements </h2>
<p>By <em>Randy Connolly</em></p>
<p><time>September 30, 2012</time></p>
</header>
...
</article>
The <hgroup> element can be used to group related
headings together within one container.
Heading Groups
<hgroup>
<header>
<hgroup>
<h1>Chapter Two: HTML 1</h1>
<h2>An Introduction</h2>
</hgroup>
</header>
<article>
<hgroup>
<h2>HTML5 Semantic Structure Elements </h2>
<h3>Overview</h3>
</hgroup>
</article>
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
The <nav> element represents a section of a page that
contains links to other pages or to other parts within
the same page.
Like the other new HTML5 semantic elements, the
browser does not apply any special presentation to
the <nav> element.
The <nav> element was intended to be used for major
navigation blocks, presumably the global and
secondary navigation systems.
Navigation
<nav>
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Navigation
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
<header>
<img src="logo.gif" alt="logo" />
<h1>Fundamentals of Web Development</h1>
<nav role="navigation">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About Us</a></li>
<li><a href="browse.html">Browse</a></li>
</ul>
</nav>
</header>
The <article> element represents a section of content
that forms an independent part of a document or site;
for example, a magazine or newspaper article, or a
blog entry.
The <section> element represents a section of a
document, typically with a title or heading.
Articles and Sections
<article> <section>
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Articles and Sections
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
According to the W3C, <section> is a much broader
element, while the <article> element is to be used for
blocks of content that could potentially be read or
consumed independently of the other content on the
page.
The WHATWG specification warns readers that the
<section> element is not a generic container element.
HTML already has the <div> element for such uses.
When an element is needed only for styling purposes
or as a convenience for scripting, it makes sense to use
the <div> element instead.
Another way to help you decide whether or not to use
the <section> element is to ask yourself if it is
appropriate for the element's contents to be listed
explicitly in the document's outline.
If so, then use a <section>; otherwise use a <div>.
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Sections versus Divs
How to decide which to use
The W3C Recommendation indicates that the <figure>
element can be used not just for images but for any
type of essential content that could be moved to a
different location in the page or document and the
rest of the document would still make sense.
Figure and Figure Captions
<figure> <figcaption>
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
The <figure> element should not be used to wrap
every image.
For instance, it makes no sense to wrap the site logo
or non-essential images such as banner ads and
graphical embellishments within <figure> elements.
Instead, only use the <figure> element for
circumstances where the image (or other content) has
a caption and where the figure is essential to the
content but its position on the page is relatively
unimportant.
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Figure and Figure Captions
Note however …
Figure and Figure Captions
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
The <aside> element is similar to the <figure> element
in that it is used for marking up content that is
separate from the main content on the page.
But while the <figure> element was used to indicate
important information whose location on the page is
somewhat unimportant, the <aside> element
“represents a section of a page that consists of
content that is tangentially related to the content
around the aside element.”
The <aside> element could thus be used for sidebars,
pull quotes, groups of advertising images, or any other
grouping of non-essential elements.
Aside
<aside>
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
What You’ve Learned
HTML Defined
and its History
HTML Syntax
Semantic Markup Structure of
HTML
Quick Tour of
HTML
HTML
Semantic
Elements
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
1
3
5
2
4
6

More Related Content

PDF
HTML: An Introduction
Randy Connolly
 
PDF
Web engineering chapter number 3 for basics
mohizkhan1996s
 
PDF
Introduction to Html
OmerMahdi
 
PPTX
Intro to HTML & Semantic Markup (Chapter 2 - Sorta Brief Version)
Nicole Ryan
 
PDF
WT Module-1.pdf
RamyaH11
 
PDF
WEB Module 1.pdf
IbrahimBadsha1
 
PPTX
Chapter04-web.pptx
ssuserf3db48
 
PPTX
Understanding the Web Page Layout
Jhaun Paul Enriquez
 
HTML: An Introduction
Randy Connolly
 
Web engineering chapter number 3 for basics
mohizkhan1996s
 
Introduction to Html
OmerMahdi
 
Intro to HTML & Semantic Markup (Chapter 2 - Sorta Brief Version)
Nicole Ryan
 
WT Module-1.pdf
RamyaH11
 
WEB Module 1.pdf
IbrahimBadsha1
 
Chapter04-web.pptx
ssuserf3db48
 
Understanding the Web Page Layout
Jhaun Paul Enriquez
 

Similar to 6th_sem_web_unit1_bahagsgsgwgbapart1.pptx (20)

PDF
Day1-HTML-CSS some basic css and html.pdf
enasashri12
 
PPTX
Introduction-to-HTML-1258164251864545.pptx
MeetRajani2
 
PPTX
HTML
Toni Kolev
 
PPTX
Gail Borden Library | HTML/CSS Program
Megan G. Johnson
 
PDF
Web Concepts - an introduction - introduction
clement swarnappa
 
PPTX
BSC notes of _HTML_Easyto understand lease see.pptx
VikasTuwar1
 
PPTX
Appdev appdev appdev app devAPPDEV 1.2.pptx
ArjayBalberan1
 
PPTX
Html in Web design and Development.pptxt.pptx
samuelasefa9
 
PPTX
HTMLHTML HTML ghdgsahdaHTML HTML ghdgsahda.pptx
SadiaBaig6
 
PDF
HTML5 - An introduction
Eleonora Ciceri
 
PPTX
HTML.pptx
Akhilapatil4
 
PPT
Web forms and html (lect 1)
Salman Memon
 
PPT
Getting started with html5
Suresh Kumar
 
PPTX
Presentation html
Billy Tierra
 
PDF
Html5 tutorial
Ali Haydar(Raj)
 
PDF
Html5 tutorial
Arjuman Shaikh
 
PDF
Html5 tutorial
Jitendra Gangwar
 
PDF
Html5 tutorial
Edress Oryakhail
 
PDF
Html5 tutorial
Divyesh Bharadava
 
Day1-HTML-CSS some basic css and html.pdf
enasashri12
 
Introduction-to-HTML-1258164251864545.pptx
MeetRajani2
 
Gail Borden Library | HTML/CSS Program
Megan G. Johnson
 
Web Concepts - an introduction - introduction
clement swarnappa
 
BSC notes of _HTML_Easyto understand lease see.pptx
VikasTuwar1
 
Appdev appdev appdev app devAPPDEV 1.2.pptx
ArjayBalberan1
 
Html in Web design and Development.pptxt.pptx
samuelasefa9
 
HTMLHTML HTML ghdgsahdaHTML HTML ghdgsahda.pptx
SadiaBaig6
 
HTML5 - An introduction
Eleonora Ciceri
 
HTML.pptx
Akhilapatil4
 
Web forms and html (lect 1)
Salman Memon
 
Getting started with html5
Suresh Kumar
 
Presentation html
Billy Tierra
 
Html5 tutorial
Ali Haydar(Raj)
 
Html5 tutorial
Arjuman Shaikh
 
Html5 tutorial
Jitendra Gangwar
 
Html5 tutorial
Edress Oryakhail
 
Html5 tutorial
Divyesh Bharadava
 
Ad

More from sagarjsicg (7)

PPTX
IoT- Introduction-19th march.pptxhhvvvvvvcc
sagarjsicg
 
PPTX
6th_sem_web_unit1_part2.pptxhshshshshshshsh
sagarjsicg
 
PPTX
unit1-text.pptx regards rgat
sagarjsicg
 
PPTX
harshaAItogetaknoeledgeaboutthewhwhw.pptx
sagarjsicg
 
PPT
1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt
sagarjsicg
 
PPTX
chapter 11,12,15.pptx kya chal the hey bhai
sagarjsicg
 
PPTX
unit 1.pptx regasts sthatbabs shshsbsvsbsh
sagarjsicg
 
IoT- Introduction-19th march.pptxhhvvvvvvcc
sagarjsicg
 
6th_sem_web_unit1_part2.pptxhshshshshshshsh
sagarjsicg
 
unit1-text.pptx regards rgat
sagarjsicg
 
harshaAItogetaknoeledgeaboutthewhwhw.pptx
sagarjsicg
 
1. OBJECT ORIENTED PROGRAMMING USING JAVA - OOps Concepts.ppt
sagarjsicg
 
chapter 11,12,15.pptx kya chal the hey bhai
sagarjsicg
 
unit 1.pptx regasts sthatbabs shshsbsvsbsh
sagarjsicg
 
Ad

Recently uploaded (20)

PPTX
Operating-Systems-A-Journey ( by information
parthbhanushali307
 
PPTX
22. PSYCHOTOGENIC DRUGS.pptx 60d7co Gurinder
sriramraja650
 
PPTX
西班牙海牙认证瓦伦西亚国际大学毕业证与成绩单文凭复刻快速办理毕业证书
sw6vvn9s
 
PPTX
basic_parts-of_computer-1618-754-622.pptx
patelravi16187
 
PPTX
great itemsgreat itemsgreat itemsgreat items.pptx
saurabh13smr
 
PPT
3 01032017tyuiryhjrhyureyhjkfdhghfrugjhf
DharaniMani4
 
PPTX
PPT on the topic of programming language
dishasindhava
 
PPTX
G6Q1 WEEK 2 SCIENCE PPT.pptxLVLLLLLLLLLLLLLLLLL
DitaSIdnay
 
PPT
L1-Intro.ppt nhfjkhghjjnnnmkkjhigtyhhjjj
MdKarimUllahEmon
 
PDF
INTEL CPU 3RD GEN.pdf variadas de computacion
juancardozzo26
 
PPTX
PHISHING ATTACKS. _. _.pptx[]
kumarrana7525
 
PPTX
Basics of Memristors and fundamentals.pptx
onterusmail
 
PPTX
cocomo-220726173706-141e08f0.tyuiuuupptx
DharaniMani4
 
PPTX
办理HFM文凭|购买代特莫尔德音乐学院毕业证文凭100%复刻安全可靠的
1cz3lou8
 
PPTX
Mobile-Device-Management-MDM-Architecture.pptx
pranavnandwanshi99
 
PPTX
atoma.pptxejejejejeejejjeejeejeju3u3u3u3
manthan912009
 
PPTX
DOC-20250728-WAprocess releases large amounts of carbon dioxide (CO₂), sulfur...
samt56673
 
PPT
community diagnosis slides show health. ppt
michaelbrucebwana
 
PPTX
Aryanbarot28.pptx Introduction of window os for the projects
aryanbarot004
 
PPTX
Basics of Memristors from zero to hero.pptx
onterusmail
 
Operating-Systems-A-Journey ( by information
parthbhanushali307
 
22. PSYCHOTOGENIC DRUGS.pptx 60d7co Gurinder
sriramraja650
 
西班牙海牙认证瓦伦西亚国际大学毕业证与成绩单文凭复刻快速办理毕业证书
sw6vvn9s
 
basic_parts-of_computer-1618-754-622.pptx
patelravi16187
 
great itemsgreat itemsgreat itemsgreat items.pptx
saurabh13smr
 
3 01032017tyuiryhjrhyureyhjkfdhghfrugjhf
DharaniMani4
 
PPT on the topic of programming language
dishasindhava
 
G6Q1 WEEK 2 SCIENCE PPT.pptxLVLLLLLLLLLLLLLLLLL
DitaSIdnay
 
L1-Intro.ppt nhfjkhghjjnnnmkkjhigtyhhjjj
MdKarimUllahEmon
 
INTEL CPU 3RD GEN.pdf variadas de computacion
juancardozzo26
 
PHISHING ATTACKS. _. _.pptx[]
kumarrana7525
 
Basics of Memristors and fundamentals.pptx
onterusmail
 
cocomo-220726173706-141e08f0.tyuiuuupptx
DharaniMani4
 
办理HFM文凭|购买代特莫尔德音乐学院毕业证文凭100%复刻安全可靠的
1cz3lou8
 
Mobile-Device-Management-MDM-Architecture.pptx
pranavnandwanshi99
 
atoma.pptxejejejejeejejjeejeejeju3u3u3u3
manthan912009
 
DOC-20250728-WAprocess releases large amounts of carbon dioxide (CO₂), sulfur...
samt56673
 
community diagnosis slides show health. ppt
michaelbrucebwana
 
Aryanbarot28.pptx Introduction of window os for the projects
aryanbarot004
 
Basics of Memristors from zero to hero.pptx
onterusmail
 

6th_sem_web_unit1_bahagsgsgwgbapart1.pptx

  • 1. RandyRandy ConnollyConnolly andand RicardoRicardo HoarHoar FundamentalsFundamentals ofof Randy Connolly and Ricardo Hoar Fundamentals of Web Development Textbook to be published by Pearson Ed in early 2 http://www.funwebdev.c 014 o Fundamentals of Web Development Randy Connolly and Ricardo Hoar © 2015 Pearson http://www.funwebdev.com HTML 1: Overview
  • 2. Objectives HTML Defined and its History HTML Syntax Semantic Markup Structure of HTML Quick Tour of HTML 1 3 5 Randy Connolly and Ricardo Hoar Fundamentals of Web Development 2 4 6 HTML Semantic Elements
  • 3. Section 1 of 6 HTML DEFINED + ITS HISTORY Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 4. • ARPANET (Advanced Research Project Agency Network)of the late 1960s by U.S DoD (Department of Defence) • jump quickly to the first public specification of the HTML by Tim Berners-Lee in 1991 • HTML’s codification by the World-Wide Web Consortium (better known as the W3C) in 1997. • (W3C is the International standards organization for www . Its task is to develop protocols and guidelines that ensure long term growth for the web). Randy Connolly and Ricardo Hoar Fundamentals of Web Development Brief History of HTML Did we mention that this will be brief?
  • 5. HTML is defined as a markup language. • A markup language is simply a way of annotating a document in such a way to make the annotations distinct from the text being annotated. • The term comes from the days of print, when editors would write instructions on manuscript pages that might be revision instructions to the author or copy editor. Randy Connolly and Ricardo Hoar Fundamentals of Web Development HTML Syntax What is a markup language?
  • 6. Sample ad hoc markup Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 7. At its simplest, markup is a way to indicate information about the content • This “information about content” in HTML is implemented via tags (aka elements). • The markup in the previous slide consists of the red text and the various circles and arrows on the one page, and the little yellow sticky notes on the other. • HTML does the same thing but uses textual tags. Randy Connolly and Ricardo Hoar Fundamentals of Web Development Markup What is it again?
  • 8. • The W3C is the main standards organization for the World Wide Web. • To promotes compatibility the W3C produces recommendations (also called specifications). • In 1998, the W3C turned its attention to a new specification called XHTML 1.0, which was a version of HTML that used stricter XML (Extensible Markup Language) syntax rules. • By 2009, the W3C stopped work on XHTML 2.0 and instead adopted the HTML5. Randy Connolly and Ricardo Hoar Fundamentals of Web Development What is the W3C? Standards
  • 9. HTML5 is the latest version of HTML and supports new markup language functionalities such as multimedia, new tags and elements as well as new API’s. There are three main aims to HTML5: • Specify unambiguously how browsers should deal with invalid markup. • Provide an open, non-proprietary programming framework (via Javascript) for creating rich web applications. • Be backwards compatible with the existing web. Randy Connolly and Ricardo Hoar Fundamentals of Web Development HTML5 Three main aims
  • 10. • While parts of the HTML5 are still being finalized, all of the major browser manufacturers have at least partially embraced HTML5. • Certainly not all browsers and all versions support every feature of HTML5. • This is in fact by design. HTML in HTML5 is now a living language: that is, it is a language that evolves and develops over time. • As such, every browser will support a gradually increasing subset of HTML5 capabilities Randy Connolly and Ricardo Hoar Fundamentals of Web Development HTML5 It evolves
  • 11. HTML5 Support in Browsers Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 12. Section 2 of 6 HTML SYNTAX Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 13. HTML documents are composed of textual content and HTML elements. An HTML element can contain text, other elements, or be empty. It is identified in the HTML document by tags. HTML elements can also contain attributes. An HTML attribute is a name=value pair that provides more information about the HTML element. In XHTML, attribute values had to be enclosed in quotes; in HTML5, the quotes are optional. Randy Connolly and Ricardo Hoar Fundamentals of Web Development Elements and Attributes More syntax
  • 14. What HTML lets you do Randy Connolly and Ricardo Hoar Fundamentals of Web Development ▪ Insert images using the <img> tag ▪ Create links with the <a> tag ▪ Create lists with the <ul>, <ol> and <li> tags ▪ Create headings with <H1>, <H2>, …, <H6> ▪ Define metatdata with <meta> tag ▪ And much more…
  • 15. Elements and Attributes Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 16. Nesting HTML elements Randy Connolly and Ricardo Hoar Fundamentals of Web Development Often an HTML element will contain other HTML elements. In such a case, the container element is said to be a parent of the contained, or child, element. Any elements contained within the child are said to be descendents of the parent element; likewise, any given child element, may have a variety of ancestors.
  • 17. Hierarchy of elements Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 18. Nesting HTML elements Randy Connolly and Ricardo Hoar Fundamentals of Web Development In order to properly construct a hierarchy of elements, your browser expects each HTML nested element to be properly nested. That is, a child’s ending tag must occur before its parent’s ending tag.
  • 19. Section 3 of 6 SEMANTIC MARKUP Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 20. Semantic markup refers to marking up a document with information about the actual data structure behind the information, rather than styling the document with exclusively visual information. Over the past decade, a strong and broad consensus has grown around the belief that HTML documents should only focus on the structure of the document. Information about how the content should look when it is displayed in the browser is best left to CSS (Cascading Style Sheets). Randy Connolly and Ricardo Hoar Fundamentals of Web Development Semantic Markup What does it mean?
  • 21. Semantic Markup Randy Connolly and Ricardo Hoar Fundamentals of Web Development As a consequence, beginning HTML authors are often counseled to create semantic HTML documents. That is, an HTML document should not describe how to visually present content, but only describe its content’s structural semantics or meaning.
  • 22. Structure Randy Connolly and Ricardo Hoar Fundamentals of Web Development Structure is a vital way of communicating information in paper and electronic documents. All of the tags that we will examine in this presentation are used to describe the basic structural information in a document, such as articles, headings, lists, paragraphs, links, images, navigation, footers, and so on.
  • 23. Eliminating presentation-oriented markup and writing semantic HTML markup has a variety of important advantages: Maintainability. Semantic markup is easier to update and change than web pages that contain a great deal of presentation markup. Faster. Semantic web pages are typically quicker to author and faster to download. Accessibility. Visiting a web page using voice reading software can be a very frustrating experience if the site does not use semantic markup. Search engine optimization. Semantic markup provides better instructions for search engines: it tells them what things are important content on the site. Randy Connolly and Ricardo Hoar Fundamentals of Web Development Semantic Markup Its advantages
  • 24. Section 4 of 6 STRUCTURE OF HTML Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 25. Simplest HTML document The <title> element (Item ) is used to provide a broad description of the content. The title is not displayed within the browser window. Instead, the title is typically displayed by the browser in its window and/or tab. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 26. A more complete document Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 27. Tells the browser (or any other client software that is reading this HTML document) what type of document it is about to process. Notice that it does not indicate what version of HTML is contained within the document: it only specifies that it contains HTML. DOCTYPE (short for Document Type Definition) Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 28. HTML, Head, and Body HTML5 does not require the use of the <html>, <head>, and <body>. However, in XHTML they were required, and most web authors continue to use them. The <html> element is sometimes called the root element as it contains all the other HTML elements in the document. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 29. Head and Body HTML pages are divided into two sections: the head and the body, which correspond to the <head> and <body> elements. The head contains descriptive elements about the document The body contains content that will be displayed by the browser. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 30. You will notice that the <head> element contains a variety of additional elements. The first of these is the <meta> element. Our example declares that the character encoding for the document is UTF-8. (This covers almost all of the characters and symbols in the world) Inside the head There are no brains Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 31. UTF-8 is an encoding system for Unicode. UTF stands for “Unicode Transformation Format” This encoding system can translate any Unicode character to a matching Unicode binary string and can also translate the binary string back to a Unicode character. What is Unicode? Unicode is an International character encoding standard that provides a unique number for every character across languages and scripts, making almost all characters accessible across platforms , programs and devices. Unicode is a universal character set that defines all the characters needed for writing the majority of living languages in use on computers. Unicode aims to be (and already is) a superset of all other encoded computer character sets. The Unicode Standard covers (almost) all characters, punctuations, and symbols in the world and enables processing, storage, and transport of text independent of platform and language.
  • 32. Our example specifies an external CSS style sheet file that is used with this document. It also references an external Javascript file. Inside the head No brains but metas, styles and javascripts Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 33. Section 5 of 6 QUICK TOUR OF HTML Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 34. Why a quick tour? Randy Connolly and Ricardo Hoar Fundamentals of Web Development HTML5 contains many structural and presentation elements – too many to completely cover in this presentation. Rather than comprehensively cover all these elements, this presentation will provide a quick overview of the most common elements.
  • 35. Sample Document Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 36. HTML provides six levels of heading (h1, h2, h3, …), with the higher heading number indicating a heading of less importance. Headings are an essential way for document authors use to show their readers the structure of the document. Randy Connolly and Ricardo Hoar Fundamentals of Web Development Headings <h1>, <h2>, <h3>, etc
  • 37. Headings Randy Connolly and Ricardo Hoar Fundamentals of Web Development The browser has its own default styling for each heading level. However, these are easily modified and customized via CSS.
  • 38. In practice, specify a heading level that is semantically accurate. Do not choose a heading level because of its default presentation • e.g., choosing <h3> because you want your text to be bold and 16pt Rather, choose the heading level because it is appropriate • e.g., choosing <h3> because it is a third level heading and not a primary or secondary heading Randy Connolly and Ricardo Hoar Fundamentals of Web Development Headings Be semantically accurate
  • 39. Paragraphs are the most basic unit of text in an HTML document. Notice that the <p> tag is a container and can contain HTML and other inline HTML elements inline HTML elements refers to HTML elements that do not cause a paragraph break but are part of the regular “flow” of the text. Paragraphs <p> Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 40. This <div> tag is also a container element and is used to create a logical grouping of content • The <div> element has no intrinsic presentation. • It is frequently used in contemporary CSS-based layouts to mark out sections. Divisions <div> Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 41. HTML5 has a variety of new semantic elements (which we will examine later) that can be used to reduce somewhat the confusing mass of div within divs within divs that is so typical of contemporary web design. Using div elements Can you say “div-tastic” Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 42. Links are created using the <a> element (the “a” stands for anchor). A link has two main parts: the destination and the label. Links <a> Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 43. Types of Links Randy Connolly and Ricardo Hoar Fundamentals of Web Development You can use the anchor element to create a wide range of links: • Links to external sites (or to individual resources such as images or movies on an external site). • Links to other pages or resources within the current site. • Links to other places within the current page. • Links to particular locations on another page. • Links that are instructions to the browser to start the user’s email program. • Links that are instructions to the browser to execute a Javascript function.
  • 44. Different link destinations Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 45. Links with the label “Click Here” were once a staple of the web. Today, such links are frowned upon, since: • they do not tell users where the link will take them • as a verb “click” is becoming increasingly inaccurate when one takes into account the growth of mobile browsers. Instead, textual link labels should be descriptive. “Click here to see the race results” “Race Results” or “See Race Results”. Randy Connolly and Ricardo Hoar Fundamentals of Web Development Link Text Some guidance … or … don’t “Click Here”
  • 46. When referencing a page or resource on an external site, a full absolute reference is required: that is, • the protocol (typically, http://), • the domain name, • any paths, and then finally • the file name of the desired resource. Randy Connolly and Ricardo Hoar Fundamentals of Web Development URL Absolute Referencing For external resources
  • 47. We also need to be able to successfully reference files within our site. This requires learning the syntax for so-called relative referencing. When referencing a resource that is on the same server as your HTML document, then you can use briefer relative referencing. If the URL does not include the “http://” then the browser will request the current server for the file. Randy Connolly and Ricardo Hoar Fundamentals of Web Development URL Relative Referencing An essential skill
  • 48. URL Relative Referencing Randy Connolly and Ricardo Hoar Fundamentals of Web Development If all the resources for the site reside within the same directory (also referred to as a folder), then you can reference those other resources simply via their filename. However, most real-world sites contain too many files to put them all within a single directory. For these situations, a relative pathname is required along with the filename. The pathname tells the browser where to locate the file on the server.
  • 49. Pathnames Randy Connolly and Ricardo Hoar Fundamentals of Web Development Pathnames on the web follow Unix conventions. • Forward slashes (“/”) are used to separate directory names from each other and from file names. • Double-periods (“..”) are used to reference a directory “above” the current one in the directory tree.
  • 50. URL Relative Referencing Relative Link Type Example Same Directory To link to a file within the same folder, simply use the file name. To link toexample.html from about.html(in Figure 2.18), use: <a href="example.html"> Child Directory To link to a file within a subdirectory, use the name of the subdirectory and a slash before the file name. To link tologo.gif from about.html, use: <a href="images/logo.gif"> Grandchild/Descendant Directory To link to a file that is multiple subdirectoriesbelow the current one, construct the full path by including each subdirectory name (separated by slashes) before the file name. To link tobackground.gif from about.html,use: <a href="css/images/background.gif" > Parent/Ancestor Directory Use “../” to reference a folderabove the current one. If trying to reference a file several levels above the current one, simply string together multiple To link toabout.html fromindex.html in members,use: <a href="../about.html"> To link toabout.html frombio.html, use: “../”. <a href="../../about.html"> Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 51. URL Relative Referencing Sibling Directory Use “../”to move up to the appropriate level, and then use the same technique as for child or grandchild directories. To link to logo.gif from index.html in members, use: <a href="../images/about.html"> To link to background.gif from bio.html, use: <a href="../../css/images/background.gif"> Root Reference An alternative approach for ancestor and sibling references is to use the so-called root reference approach. In this approach, begin the reference with the root reference (the “/”) and then use the same technique as for child or grandchild directories. Note that these will only work on the server! That is, they will not work when you test it out on your local machine. To link to about.html from bio.html, use: <a href="/about.html"> To link to background.gif from bio.html, use: <a href="/images/background.gif"> Default Document Web servers allow references to directory names without file names. In such a case, the web server will serve the default document, which is usually a file called index.html (apache) or default.html (IIS). Again, this will only generally work on the web server. To link to index.html in members from about.html, use either: <a href="members"> Or <a href="/members"> Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 52. Inline elements do not disrupt the flow of text (i.e., cause a line break). HTML5 defines over 30 of these elements. e.g., <a>, <br>, <em>, <strong> Randy Connolly and Ricardo Hoar Fundamentals of Web Development Inline Text Elements Do not disrupt the flow
  • 53. Images Randy Connolly and Ricardo Hoar Fundamentals of Web Development While the <img> tag is the oldest method for displaying an image, it is not the only way. For purely decorative images, such as background gradients and patterns, logos, border art, and so on, it makes semantic sense to keep such images out of the markup and in CSS where they more rightly belong. But when the images are content, such as in the images in a gallery or the image of a product in a product details page, then the <img> tag is the semantically appropriate approach.
  • 54. Images Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 55. Unordered lists. Collections of items in no particular order; these are by default rendered by the browser as a bulleted list. Ordered lists. Collections of items that have a set order; these are by default rendered by the browser as a numbered list. Definition lists. Collection of name and definition pairs. These tend to be used infrequently. Perhaps the most common example would be a FAQ list. Randy Connolly and Ricardo Hoar Fundamentals of Web Development Lists HTML provides three types of lists
  • 56. Lists Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 57. Character Entities Randy Connolly and Ricardo Hoar Fundamentals of Web Development These are special characters for symbols for which there is either no way easy way to type in via a keyboard (such as the copyright symbol or accented characters) or which have a reserved meaning in HTML (for instance the “<” or “>” symbols). They can be used in an HTML document by using the entity name or the entity number. e.g., &nbsp; and &copy;
  • 59. Section 6 of 6 HTML SEMANTIC ELEMENTS Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 60. One substantial problem with modern, pre-HTML5 semantic markup: most complex web sites are absolutely packed solid with <div> elements. Unfortunately, all these <div> elements can make the resulting markup confusing and hard to modify. Developers typically try to bring some sense and order to the <div> chaos by using id or class names that provide some clue as to their meaning. Randy Connolly and Ricardo Hoar Fundamentals of Web Development HTML5 Semantic Elements Why are they needed?
  • 62. XHTML versus HTML5 Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 63. Most web site pages have a recognizable header and footer section. Typically the header contains • the site logo • title (and perhaps additional subtitles or taglines) • horizontal navigation links, and • perhaps one or two horizontal banners. Header and Footer <header> <footer> Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 64. The typical footer contains less important material, such as • smaller text versions of the navigation, • copyright notices, • information about the site’s privacy policy, and • perhaps twitter feeds or links to other social sites. Header and Footer <header> <footer> Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 65. Header and Footer Randy Connolly and Ricardo Hoar Fundamentals of Web Development Both the HTML5 <header> and <footer> element can be used not only for page headers and footers, they can also be used for header and footer elements within other HTML5 containers, such as <article> or <section>. <header> <img src="logo.gif" alt="logo" /> <h1>Fundamentals of Web Development</h1> ... </header> <article> <header> <h2>HTML5 Semantic Structure Elements </h2> <p>By <em>Randy Connolly</em></p> <p><time>September 30, 2012</time></p> </header> ... </article>
  • 66. The <hgroup> element can be used to group related headings together within one container. Heading Groups <hgroup> <header> <hgroup> <h1>Chapter Two: HTML 1</h1> <h2>An Introduction</h2> </hgroup> </header> <article> <hgroup> <h2>HTML5 Semantic Structure Elements </h2> <h3>Overview</h3> </hgroup> </article> Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 67. The <nav> element represents a section of a page that contains links to other pages or to other parts within the same page. Like the other new HTML5 semantic elements, the browser does not apply any special presentation to the <nav> element. The <nav> element was intended to be used for major navigation blocks, presumably the global and secondary navigation systems. Navigation <nav> Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 68. Navigation Randy Connolly and Ricardo Hoar Fundamentals of Web Development <header> <img src="logo.gif" alt="logo" /> <h1>Fundamentals of Web Development</h1> <nav role="navigation"> <ul> <li><a href="index.html">Home</a></li> <li><a href="about.html">About Us</a></li> <li><a href="browse.html">Browse</a></li> </ul> </nav> </header>
  • 69. The <article> element represents a section of content that forms an independent part of a document or site; for example, a magazine or newspaper article, or a blog entry. The <section> element represents a section of a document, typically with a title or heading. Articles and Sections <article> <section> Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 70. Articles and Sections Randy Connolly and Ricardo Hoar Fundamentals of Web Development According to the W3C, <section> is a much broader element, while the <article> element is to be used for blocks of content that could potentially be read or consumed independently of the other content on the page.
  • 71. The WHATWG specification warns readers that the <section> element is not a generic container element. HTML already has the <div> element for such uses. When an element is needed only for styling purposes or as a convenience for scripting, it makes sense to use the <div> element instead. Another way to help you decide whether or not to use the <section> element is to ask yourself if it is appropriate for the element's contents to be listed explicitly in the document's outline. If so, then use a <section>; otherwise use a <div>. Randy Connolly and Ricardo Hoar Fundamentals of Web Development Sections versus Divs How to decide which to use
  • 72. The W3C Recommendation indicates that the <figure> element can be used not just for images but for any type of essential content that could be moved to a different location in the page or document and the rest of the document would still make sense. Figure and Figure Captions <figure> <figcaption> Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 73. The <figure> element should not be used to wrap every image. For instance, it makes no sense to wrap the site logo or non-essential images such as banner ads and graphical embellishments within <figure> elements. Instead, only use the <figure> element for circumstances where the image (or other content) has a caption and where the figure is essential to the content but its position on the page is relatively unimportant. Randy Connolly and Ricardo Hoar Fundamentals of Web Development Figure and Figure Captions Note however …
  • 74. Figure and Figure Captions Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 75. The <aside> element is similar to the <figure> element in that it is used for marking up content that is separate from the main content on the page. But while the <figure> element was used to indicate important information whose location on the page is somewhat unimportant, the <aside> element “represents a section of a page that consists of content that is tangentially related to the content around the aside element.” The <aside> element could thus be used for sidebars, pull quotes, groups of advertising images, or any other grouping of non-essential elements. Aside <aside> Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 76. What You’ve Learned HTML Defined and its History HTML Syntax Semantic Markup Structure of HTML Quick Tour of HTML HTML Semantic Elements Randy Connolly and Ricardo Hoar Fundamentals of Web Development 1 3 5 2 4 6