SlideShare une entreprise Scribd logo
1  sur  57
Web Design Principles
5th
Edition
Chapter One
Writing HTML for the Modern Web
Objectives
In this chapter, you will learn about:
• Creating Web pages with HTML
• The history of HTML
• Working with HTML5
• Choosing an HTML editor
• Using good coding practices
2Web Design Principles 5th
Ed.
Creating Web Pages with HTML
Creating Web Pages with HTML
• HTML is a markup language that lets you identify
common sections of a Web page
• Markup elements define each section
• This <h1> element defines text as a first-level
heading:
<h1>What is HTML?</h1>
4Web Design Principles 5th
Ed.
Creating Web Pages with HTML
5Web Design Principles 5th
Ed.
Structure of a Basic Web Page
• The HTML file contains content text and HTML
markup
• The HTML markup does not appear in the browser
• The browser interprets the code and displays the
results
6Web Design Principles 5th
Ed.
7Web Design Principles 5th
Ed.
Structure of a Basic Web Page
• The document type, or doctype for short, specifies
the rules for the document language
• The <html> tag is the root element
• The two main sections are the <head> and <body>
elements
• The head section is the container for all of the
descriptive information about the document
• The <body> section includes the content that the
user sees in the browser window
8Web Design Principles 5th
Ed.
Structure of a Basic Web Page
• The body of the document can contain:
– Text
– Images
– Video content
– Audio content
– Forms for gathering information
– Interactive content
– Links to other Web resources
9Web Design Principles 5th
Ed.
HTML in the Browser
• The browser interprets the HTML markup elements
and displays the results, hiding the actual markup
from the user
• Each browser interprets HTML in its own way,
based on its rendering engine
• It is essential that you test your work in different
Web browsers
10Web Design Principles 5th
Ed.
11Web Design Principles 5th
Ed.
Adding Style with CSS
• Web designers use Cascading Style Sheets (CSS)
to add presentation information to Web pages
• With CSS you can display information for different
devices
• With style sheets, the presentation properties are
separate from the content
• CSS lets you control the presentation
characteristics of an entire Web site with a single
style sheet
12Web Design Principles 5th
Ed.
13Web Design Principles 5th
Ed.
Adding Style with CSS
• The next two figures show CSS style rules and the
result in the browser
• The style rules in Figure 1-5 specify that the body
text for the page will be Arial, the h1 will have a
bottom border, and the paragraph will have a 30-
pixel left margin.
• Figure 1-6 shows the results in Firefox
14Web Design Principles 5th
Ed.
15Web Design Principles 5th
Ed.
16Web Design Principles 5th
Ed.
Organizing Information with
Hypertext
• The World Wide Web links information on related
topics using hypertext
• You determine which terms to create as hypertext
links and where users end up when they click a link
• The different types of linked content and media
continually evolve
17Web Design Principles 5th
Ed.
The History of HTML
The History of HTML
• As a Web designer, you will encounter all types of
HTML coding practices
• Understanding the evolution of HTML will help you
understand various Web design methods
• To be a successful Web designer, you need to
understand the past, present, and future directions
of HTML, coding standards, and common practices
19Web Design Principles 5th
Ed.
The History of HTML
• Tim Berners-Lee first proposed HTML at the
European Laboratory for Particle Physics (CERN)
in 1989
• Berners-Lee joined the ideas of the browser, a
markup language (HTML), and a communications
protocol that allowed hypertext linking
• Not only could people read documents, they could
easily create them using HTML
20Web Design Principles 5th
Ed.
The History of HTML
• HTML is an application of the Standard
Generalized Markup Language (SGML), a standard
system for specifying document structure
• Berners-Lee joined the ideas of the user interface
(browser), a markup language (HTML), and a
communications protocol (http:) that allowed
hypertext linking
21Web Design Principles 5th
Ed.
A Need for Standards
• The World Wide Web Consortium (W3C) was
founded in 1994 MIT
• The World Wide Web Consortium sets standards
for HTML and other markup languages
• Jointly developed standards, rather than ones
dictated by one vendor, benefit everyone
22Web Design Principles 5th
Ed.
A Need for Standards
23Web Design Principles 5th
Ed.
XML and XHTML – A New Direction
• In 1997, the W3C released XML, the Extensible
Markup Language
• XML is essential to creating applications for the
Web
• XML lets developers define their own markup
language
• XML has a stricter syntax than HTML
24Web Design Principles 5th
Ed.
XML Syntax Rules
• Documents must be well-formed
• All tags must nest properly and not overlap
• Use all lowercase for element names
• Always use closing tags
• Empty elements are signified by a closing slash
• Attribute values must be contained in quotation
marks
25Web Design Principles 5th
Ed.
Sample XML
<poem>
<title>An Ode to the Web</title>
<stanza>
<line>So many Web sites</line>
<line>So little time</line>
<line>And all I want to do</line>
<line>Is critique their design!</line>
</stanza>
</poem>
26Web Design Principles 5th
Ed.
XML and XHTML – A New Direction
• XML syntax provides a solution to the problem of
widely varying HTML coding standards
• The W3C combined XML and HTML to create
XHTML
• XHTML follows the rules of XML
• Web developers readily adopted XHTML and CSS
to standardize coding
• Many Web sites benefited from leaner
standardized code
27Web Design Principles 5th
Ed.
Problems with XHTML
• Relaxed syntax rules still must be applied because
of legacy code
• Newer versions of XHTML moved too far away
from existing Web development
• XHTML was not well received by the development
community
28Web Design Principles 5th
Ed.
A Proposal for HTML5
• The Web Hypertext Application Technology
Working Group (WHATWG) proposed HTML5
• HTML5:
– Supports standards-based coding
– Compatible with HTML and XHTML
– Compatible with CSS
– Supports new page layout elements
– Application and media compatible
29Web Design Principles 5th
Ed.
Working with HTML5
Working with HTML5
• HTML5 attempts to address shortcomings of HTML
• Addresses needs of modern Web design
• Offers new features:
– Logical layout elements
– Rich media
– Support for applications
• Removes old features:
– All display elements have been removed in favor of
CSS
– Framesets are gone
31Web Design Principles 5th
Ed.
Working with HTML5
HTML5 offers two syntaxes:
– An HTML-compatible syntax
– An XML-compatible syntax
• HTML-compatible syntax
– More relaxed syntax
– Code shortcuts allowed
• XML-compatible syntax
– Consistent with XHTML
– Uses XML syntax rules
32Web Design Principles 5th
Ed.
Working with HTML5
33Web Design Principles 5th
Ed.
Working with HTML5
34Web Design Principles 5th
Ed.
Choosing the Correct Syntax
• HTML5 allows a mixture of these two types of
syntax into one document
• A polyglot document: mixed language
• Use XML coding standards in your HTML
documents
• Lets you create standardized, compatible code
35Web Design Principles 5th
Ed.
Choosing the Correct doctype
• Always use a doctype statement
• Using a doctype forces the browser to display in
standards mode
• The standard doctype statement for HTML5:
<!DOCTYPE html>
36Web Design Principles 5th
Ed.
Choosing the Correct MIME type
• Multipurpose Internet Mail Extensions (MIME)
defines content types for the Web
• Determines the type of document
• Declared in a <meta> element in the <head>
section
• Also contains a character set identifier
• Your <meta> element should look like this:
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8">
37Web Design Principles 5th
Ed.
Creating Syntactically Correct Code
• Documents must be well-formed
• All tags must nest properly and not overlap
• Use all lowercase for element names
• Always use closing tags
• Empty elements are marked with a closing slash
• Attribute values must be contained in quotation
marks
38Web Design Principles 5th
Ed.
HTML5 Element Categories
• Metadata content
• Flow content
• Sectioning root
• Sectioning content
• Heading content
• Phrasing content
• Embedded content
• Interactive content
• Transparent
39Web Design Principles 5th
Ed.
New Elements in HTML5
• HTML5 has a number of new elements; see Table
1-2 in the text
• Not all elements are supported by current browsers
• Test new elements carefully
40Web Design Principles 5th
Ed.
Attributes in HTML5
• Elements can contain attributes that set properties
• Earlier versions of HTML had more attributes
• HTML5 has less attributes because of CSS
• Global attributes can be applied to any element
41Web Design Principles 5th
Ed.
Obsolete Elements in HTML5
• Many elements have been removed in HTML,
mostly involving presentation effects
• Framesets are no longer available
42Web Design Principles 5th
Ed.
Using HTML5 Elements for
Page Structure
• Most Web pages contain common characteristics:
– Header
– Navigation
– Articles
– Figures
– Footers
– Sidebars
• These are currently marked up with <div> elements
and id or class names
43Web Design Principles 5th
Ed.
44Web Design Principles 5th
Ed.
• HTML5 offers a new set of elements for describing
document structure
• HTML5 replaces the use of <div> with named
elements to structure the page
• The <article> element can be used instead of the
<div> element, for example:
<article>This is the main content of
the Web page</article>
Using HTML5 Elements for
Page Structure
45Web Design Principles 5th
Ed.
Using HTML5 Elements for
Page Structure
• The HTML5 elements for page layout include:
– <header> Contains the page header content
– <nav> Contains the navigation elements for the page
– <article> Contains the primary page content
– <section> Defines sections or groupings of page
content
– <aside> Contains additional content such as a quote
or sidebar
– <figure> Contains images for the article content
– <footer> Contains page footer content
46Web Design Principles 5th
Ed.
Interactive Capabilities in HTML5
• Audio and video
• Drawing canvas
• Background application processing
• Local data storage
47Web Design Principles 5th
Ed.
Choosing an HTML Editor
Choosing an HTML Editor
• Editors are either code-based or WYSIWYG (What
You See is What You Get)
• Some editors offer both methods
• Many editors offer built-in code validators and FTP
clients
• You can find low-cost freeware or shareware
editors
• You can also use a text editor to create Web pages
49Web Design Principles 5th
Ed.
Choosing an HTML Editor
• HTML editors contain their own logic for
interpreting code
• Make sure to check your work in multiple browsers
• Some editors create overly complex code
50Web Design Principles 5th
Ed.
Using Good Coding Practices
Using Good Coding Practices
• Creating code that ensures the greatest standards-
compliance, presentation, and usefulness of your
content
– Stick to the standards
– Use semantic markup
– Validate your code
52Web Design Principles 5th
Ed.
Stick to the Standards
• Stick to the W3C standards
• Separate content from presentation
• Plan to be accessible to different devices
• Standardized design is more accessible
53Web Design Principles 5th
Ed.
Use Semantic Markup
• Semantic markup identifies the intended use of
document sections
• Accurately describes each piece of content
• Until recently, this logical use of the HTML
elements was largely ignored
• Document elements match the meaning and usage
of the document sections: <p> for paragraph, <h1>
for top-level heading, and so on
54Web Design Principles 5th
Ed.
Validate Your Code
• Valid code conforms to the usage rules of the W3C
• The lack of valid code is a major problem
• Valid code enhances browser compatibility,
accessibility, and exchange of data
• The most common mistakes include:
– No doctype declaration
– Missing closing tags
– Missing alt attributes in <img> elements
– Incorrect tag nesting
– Unquoted attributes
55Web Design Principles 5th
Ed.
Migrating from Legacy HTML to
HTML5
• The transition should be a gradual process
• Clean up code on existing pages
• Plan coding conventions for new pages, removing
deprecated elements
• Move display information to CSS
• Test for backwards compatibility
56Web Design Principles 5th
Ed.
Summary
• Make sure to check for support of new HTML5
elements, and test carefully before adding them to
your Web site
• Use the HTML5 naming conventions to name the
content sections of your site even if only using
them as class or id names
• Use Cascading Style Sheets
• Decide whether to code to the XML standard
• Use good coding practices
57Web Design Principles 5th
Ed.

Contenu connexe

Tendances

Using CSS Paging to Render DITA Documents
Using CSS Paging to Render DITA DocumentsUsing CSS Paging to Render DITA Documents
Using CSS Paging to Render DITA DocumentsContrext Solutions
 
Xhtml and html5 basics
Xhtml and html5 basicsXhtml and html5 basics
Xhtml and html5 basicsmessinam
 
Technical writing tools
Technical writing toolsTechnical writing tools
Technical writing toolsAnil Menon
 
Cool Tools for Technical Writers
Cool Tools for Technical WritersCool Tools for Technical Writers
Cool Tools for Technical WritersJeff Haas
 
Simply Accessible - Kevin Callahan - ebookcraft 2018
Simply Accessible - Kevin Callahan - ebookcraft 2018Simply Accessible - Kevin Callahan - ebookcraft 2018
Simply Accessible - Kevin Callahan - ebookcraft 2018BookNet Canada
 
Ch 2: How the Web Works
Ch 2: How the Web WorksCh 2: How the Web Works
Ch 2: How the Web WorksSteve Guinan
 
Connecting Intelligent Content with Micropublishing and Beyond
Connecting Intelligent Content with Micropublishing and BeyondConnecting Intelligent Content with Micropublishing and Beyond
Connecting Intelligent Content with Micropublishing and BeyondDon Day
 
Share point 2013 WCM for Developers
Share point 2013 WCM for DevelopersShare point 2013 WCM for Developers
Share point 2013 WCM for DevelopersSuhas R Satish
 
New from BookNet Canada: BNC BiblioShare - Tim Middleton - Tech Forum 2018
New from BookNet Canada: BNC BiblioShare - Tim Middleton - Tech Forum 2018New from BookNet Canada: BNC BiblioShare - Tim Middleton - Tech Forum 2018
New from BookNet Canada: BNC BiblioShare - Tim Middleton - Tech Forum 2018BookNet Canada
 
Fii Practic Frontend BeeNear - laborator 1
Fii Practic Frontend BeeNear - laborator 1Fii Practic Frontend BeeNear - laborator 1
Fii Practic Frontend BeeNear - laborator 1BeeNear
 
Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2Shyamala Prayaga
 

Tendances (20)

Ppt ch05
Ppt ch05Ppt ch05
Ppt ch05
 
Ppt ch09
Ppt ch09Ppt ch09
Ppt ch09
 
Ppt ch10
Ppt ch10Ppt ch10
Ppt ch10
 
Ppt ch06
Ppt ch06Ppt ch06
Ppt ch06
 
Html,CSS & UI/UX design
Html,CSS & UI/UX designHtml,CSS & UI/UX design
Html,CSS & UI/UX design
 
Ppt ch03
Ppt ch03Ppt ch03
Ppt ch03
 
Using CSS Paging to Render DITA Documents
Using CSS Paging to Render DITA DocumentsUsing CSS Paging to Render DITA Documents
Using CSS Paging to Render DITA Documents
 
Ui devopler
Ui devoplerUi devopler
Ui devopler
 
Xhtml and html5 basics
Xhtml and html5 basicsXhtml and html5 basics
Xhtml and html5 basics
 
Ch1
Ch1Ch1
Ch1
 
Technical writing tools
Technical writing toolsTechnical writing tools
Technical writing tools
 
Cool Tools for Technical Writers
Cool Tools for Technical WritersCool Tools for Technical Writers
Cool Tools for Technical Writers
 
Simply Accessible - Kevin Callahan - ebookcraft 2018
Simply Accessible - Kevin Callahan - ebookcraft 2018Simply Accessible - Kevin Callahan - ebookcraft 2018
Simply Accessible - Kevin Callahan - ebookcraft 2018
 
Ch 2: How the Web Works
Ch 2: How the Web WorksCh 2: How the Web Works
Ch 2: How the Web Works
 
Connecting Intelligent Content with Micropublishing and Beyond
Connecting Intelligent Content with Micropublishing and BeyondConnecting Intelligent Content with Micropublishing and Beyond
Connecting Intelligent Content with Micropublishing and Beyond
 
Share point 2013 WCM for Developers
Share point 2013 WCM for DevelopersShare point 2013 WCM for Developers
Share point 2013 WCM for Developers
 
New from BookNet Canada: BNC BiblioShare - Tim Middleton - Tech Forum 2018
New from BookNet Canada: BNC BiblioShare - Tim Middleton - Tech Forum 2018New from BookNet Canada: BNC BiblioShare - Tim Middleton - Tech Forum 2018
New from BookNet Canada: BNC BiblioShare - Tim Middleton - Tech Forum 2018
 
Fii Practic Frontend BeeNear - laborator 1
Fii Practic Frontend BeeNear - laborator 1Fii Practic Frontend BeeNear - laborator 1
Fii Practic Frontend BeeNear - laborator 1
 
Mahara Development for Moodle Developers
Mahara Development for Moodle DevelopersMahara Development for Moodle Developers
Mahara Development for Moodle Developers
 
Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2
 

En vedette

Olutionmanual microprocessorsand interfacing-dv-hall
Olutionmanual microprocessorsand interfacing-dv-hallOlutionmanual microprocessorsand interfacing-dv-hall
Olutionmanual microprocessorsand interfacing-dv-hallky phung
 
Evaluation question 5
Evaluation question 5Evaluation question 5
Evaluation question 5Will Kearse
 
"Город на віконці"
"Город на віконці""Город на віконці"
"Город на віконці"Julja Chernenko
 
นายศูภานุพงษ์ พานิชวัฒนะ ม4/12 เลขที่ 26
นายศูภานุพงษ์    พานิชวัฒนะ   ม4/12  เลขที่ 26นายศูภานุพงษ์    พานิชวัฒนะ   ม4/12  เลขที่ 26
นายศูภานุพงษ์ พานิชวัฒนะ ม4/12 เลขที่ 26Supanupong Panichwatthana
 
uk-cyber-security-strategy-final-2
uk-cyber-security-strategy-final-2uk-cyber-security-strategy-final-2
uk-cyber-security-strategy-final-2Elisha Quaye
 
Табір "Подоляночка"
Табір  "Подоляночка" Табір  "Подоляночка"
Табір "Подоляночка" Julja Chernenko
 
батьківські збори
батьківські зборибатьківські збори
батьківські збориJulja Chernenko
 

En vedette (20)

Spanish 2
Spanish 2Spanish 2
Spanish 2
 
Personalisatie & ROI
Personalisatie & ROIPersonalisatie & ROI
Personalisatie & ROI
 
Olutionmanual microprocessorsand interfacing-dv-hall
Olutionmanual microprocessorsand interfacing-dv-hallOlutionmanual microprocessorsand interfacing-dv-hall
Olutionmanual microprocessorsand interfacing-dv-hall
 
10 клас
10 клас10 клас
10 клас
 
Evaluation question 5
Evaluation question 5Evaluation question 5
Evaluation question 5
 
WHATSAPP MASIVO
WHATSAPP MASIVOWHATSAPP MASIVO
WHATSAPP MASIVO
 
3 клас
3 клас3 клас
3 клас
 
"Город на віконці"
"Город на віконці""Город на віконці"
"Город на віконці"
 
Quality matters
Quality mattersQuality matters
Quality matters
 
6 клас
6 клас6 клас
6 клас
 
นายศูภานุพงษ์ พานิชวัฒนะ ม4/12 เลขที่ 26
นายศูภานุพงษ์    พานิชวัฒนะ   ม4/12  เลขที่ 26นายศูภานุพงษ์    พานิชวัฒนะ   ม4/12  เลขที่ 26
นายศูภานุพงษ์ พานิชวัฒนะ ม4/12 เลขที่ 26
 
Ppt ch06
Ppt ch06Ppt ch06
Ppt ch06
 
uk-cyber-security-strategy-final-2
uk-cyber-security-strategy-final-2uk-cyber-security-strategy-final-2
uk-cyber-security-strategy-final-2
 
1 клас
1 клас1 клас
1 клас
 
Табір "Подоляночка"
Табір  "Подоляночка" Табір  "Подоляночка"
Табір "Подоляночка"
 
8 кл
8 кл8 кл
8 кл
 
херсон
херсонхерсон
херсон
 
Graphic Design
Graphic DesignGraphic Design
Graphic Design
 
Intro to Class Dojo
Intro to Class DojoIntro to Class Dojo
Intro to Class Dojo
 
батьківські збори
батьківські зборибатьківські збори
батьківські збори
 

Similaire à HTML5 Web Page Structure

9781111528705_PPT_ch013.pptx
9781111528705_PPT_ch013.pptx9781111528705_PPT_ch013.pptx
9781111528705_PPT_ch013.pptxSimonChirambira
 
9781111528705_PPT_ch01.pptx
9781111528705_PPT_ch01.pptx9781111528705_PPT_ch01.pptx
9781111528705_PPT_ch01.pptxSimonChirambira
 
9781111528705_PPT_ch014.pptx
9781111528705_PPT_ch014.pptx9781111528705_PPT_ch014.pptx
9781111528705_PPT_ch014.pptxSimonChirambira
 
9781111528705_PPT_ch012.pptx
9781111528705_PPT_ch012.pptx9781111528705_PPT_ch012.pptx
9781111528705_PPT_ch012.pptxSimonChirambira
 
9781285852645_CH01 research and analysis of data.pptx
9781285852645_CH01 research and analysis of data.pptx9781285852645_CH01 research and analysis of data.pptx
9781285852645_CH01 research and analysis of data.pptxclement swarnappa
 
02 From HTML tags to XHTML
02 From HTML tags to XHTML02 From HTML tags to XHTML
02 From HTML tags to XHTMLRich Dron
 
05 RD PoSD Tutorial_xhtml_to_html5_2016
05 RD PoSD Tutorial_xhtml_to_html5_201605 RD PoSD Tutorial_xhtml_to_html5_2016
05 RD PoSD Tutorial_xhtml_to_html5_2016Rich Dron
 
HTML Demo.ppt
HTML Demo.pptHTML Demo.ppt
HTML Demo.pptLimEchYrr
 
9781111528705_PPT_ch04.ppt
9781111528705_PPT_ch04.ppt9781111528705_PPT_ch04.ppt
9781111528705_PPT_ch04.pptSimonChirambira
 
WT Module-1.pdf
WT Module-1.pdfWT Module-1.pdf
WT Module-1.pdfRamyaH11
 
Ddpz2613 topic1 introduction
Ddpz2613 topic1 introductionDdpz2613 topic1 introduction
Ddpz2613 topic1 introductionMohamad Sahiedan
 
Presentation 1 Web--dev
Presentation 1 Web--devPresentation 1 Web--dev
Presentation 1 Web--devaltsav
 
Web design using html
Web design using htmlWeb design using html
Web design using htmlElsaS7
 
Training presentation
Training presentationTraining presentation
Training presentationTayseer_Emam
 

Similaire à HTML5 Web Page Structure (20)

9781111528705_PPT_ch013.pptx
9781111528705_PPT_ch013.pptx9781111528705_PPT_ch013.pptx
9781111528705_PPT_ch013.pptx
 
9781111528705_PPT_ch01.pptx
9781111528705_PPT_ch01.pptx9781111528705_PPT_ch01.pptx
9781111528705_PPT_ch01.pptx
 
9781111528705_PPT_ch014.pptx
9781111528705_PPT_ch014.pptx9781111528705_PPT_ch014.pptx
9781111528705_PPT_ch014.pptx
 
9781111528705_PPT_ch012.pptx
9781111528705_PPT_ch012.pptx9781111528705_PPT_ch012.pptx
9781111528705_PPT_ch012.pptx
 
9781285852645_CH01 research and analysis of data.pptx
9781285852645_CH01 research and analysis of data.pptx9781285852645_CH01 research and analysis of data.pptx
9781285852645_CH01 research and analysis of data.pptx
 
02 From HTML tags to XHTML
02 From HTML tags to XHTML02 From HTML tags to XHTML
02 From HTML tags to XHTML
 
05 RD PoSD Tutorial_xhtml_to_html5_2016
05 RD PoSD Tutorial_xhtml_to_html5_201605 RD PoSD Tutorial_xhtml_to_html5_2016
05 RD PoSD Tutorial_xhtml_to_html5_2016
 
HTML Demo.ppt
HTML Demo.pptHTML Demo.ppt
HTML Demo.ppt
 
9781111528705_PPT_ch04.ppt
9781111528705_PPT_ch04.ppt9781111528705_PPT_ch04.ppt
9781111528705_PPT_ch04.ppt
 
Dhtml ppt (2)
Dhtml ppt (2)Dhtml ppt (2)
Dhtml ppt (2)
 
HTML.pptx
HTML.pptxHTML.pptx
HTML.pptx
 
Html5
Html5 Html5
Html5
 
WT Module-1.pdf
WT Module-1.pdfWT Module-1.pdf
WT Module-1.pdf
 
Html vs xhtml
Html vs xhtmlHtml vs xhtml
Html vs xhtml
 
Html.pptx
Html.pptxHtml.pptx
Html.pptx
 
Ddpz2613 topic1 introduction
Ddpz2613 topic1 introductionDdpz2613 topic1 introduction
Ddpz2613 topic1 introduction
 
wt mod1.pdf
wt mod1.pdfwt mod1.pdf
wt mod1.pdf
 
Presentation 1 Web--dev
Presentation 1 Web--devPresentation 1 Web--dev
Presentation 1 Web--dev
 
Web design using html
Web design using htmlWeb design using html
Web design using html
 
Training presentation
Training presentationTraining presentation
Training presentation
 

Plus de niruttisai (9)

Ppt ch12
Ppt ch12Ppt ch12
Ppt ch12
 
Ppt ch11
Ppt ch11Ppt ch11
Ppt ch11
 
Ppt ch10
Ppt ch10Ppt ch10
Ppt ch10
 
Ppt ch09
Ppt ch09Ppt ch09
Ppt ch09
 
Ppt ch08
Ppt ch08Ppt ch08
Ppt ch08
 
Ppt ch07
Ppt ch07Ppt ch07
Ppt ch07
 
Ppt ch04
Ppt ch04Ppt ch04
Ppt ch04
 
Ppt ch05
Ppt ch05Ppt ch05
Ppt ch05
 
-
--
-
 

Dernier

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Dernier (20)

E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

HTML5 Web Page Structure

  • 1. Web Design Principles 5th Edition Chapter One Writing HTML for the Modern Web
  • 2. Objectives In this chapter, you will learn about: • Creating Web pages with HTML • The history of HTML • Working with HTML5 • Choosing an HTML editor • Using good coding practices 2Web Design Principles 5th Ed.
  • 3. Creating Web Pages with HTML
  • 4. Creating Web Pages with HTML • HTML is a markup language that lets you identify common sections of a Web page • Markup elements define each section • This <h1> element defines text as a first-level heading: <h1>What is HTML?</h1> 4Web Design Principles 5th Ed.
  • 5. Creating Web Pages with HTML 5Web Design Principles 5th Ed.
  • 6. Structure of a Basic Web Page • The HTML file contains content text and HTML markup • The HTML markup does not appear in the browser • The browser interprets the code and displays the results 6Web Design Principles 5th Ed.
  • 8. Structure of a Basic Web Page • The document type, or doctype for short, specifies the rules for the document language • The <html> tag is the root element • The two main sections are the <head> and <body> elements • The head section is the container for all of the descriptive information about the document • The <body> section includes the content that the user sees in the browser window 8Web Design Principles 5th Ed.
  • 9. Structure of a Basic Web Page • The body of the document can contain: – Text – Images – Video content – Audio content – Forms for gathering information – Interactive content – Links to other Web resources 9Web Design Principles 5th Ed.
  • 10. HTML in the Browser • The browser interprets the HTML markup elements and displays the results, hiding the actual markup from the user • Each browser interprets HTML in its own way, based on its rendering engine • It is essential that you test your work in different Web browsers 10Web Design Principles 5th Ed.
  • 12. Adding Style with CSS • Web designers use Cascading Style Sheets (CSS) to add presentation information to Web pages • With CSS you can display information for different devices • With style sheets, the presentation properties are separate from the content • CSS lets you control the presentation characteristics of an entire Web site with a single style sheet 12Web Design Principles 5th Ed.
  • 14. Adding Style with CSS • The next two figures show CSS style rules and the result in the browser • The style rules in Figure 1-5 specify that the body text for the page will be Arial, the h1 will have a bottom border, and the paragraph will have a 30- pixel left margin. • Figure 1-6 shows the results in Firefox 14Web Design Principles 5th Ed.
  • 17. Organizing Information with Hypertext • The World Wide Web links information on related topics using hypertext • You determine which terms to create as hypertext links and where users end up when they click a link • The different types of linked content and media continually evolve 17Web Design Principles 5th Ed.
  • 19. The History of HTML • As a Web designer, you will encounter all types of HTML coding practices • Understanding the evolution of HTML will help you understand various Web design methods • To be a successful Web designer, you need to understand the past, present, and future directions of HTML, coding standards, and common practices 19Web Design Principles 5th Ed.
  • 20. The History of HTML • Tim Berners-Lee first proposed HTML at the European Laboratory for Particle Physics (CERN) in 1989 • Berners-Lee joined the ideas of the browser, a markup language (HTML), and a communications protocol that allowed hypertext linking • Not only could people read documents, they could easily create them using HTML 20Web Design Principles 5th Ed.
  • 21. The History of HTML • HTML is an application of the Standard Generalized Markup Language (SGML), a standard system for specifying document structure • Berners-Lee joined the ideas of the user interface (browser), a markup language (HTML), and a communications protocol (http:) that allowed hypertext linking 21Web Design Principles 5th Ed.
  • 22. A Need for Standards • The World Wide Web Consortium (W3C) was founded in 1994 MIT • The World Wide Web Consortium sets standards for HTML and other markup languages • Jointly developed standards, rather than ones dictated by one vendor, benefit everyone 22Web Design Principles 5th Ed.
  • 23. A Need for Standards 23Web Design Principles 5th Ed.
  • 24. XML and XHTML – A New Direction • In 1997, the W3C released XML, the Extensible Markup Language • XML is essential to creating applications for the Web • XML lets developers define their own markup language • XML has a stricter syntax than HTML 24Web Design Principles 5th Ed.
  • 25. XML Syntax Rules • Documents must be well-formed • All tags must nest properly and not overlap • Use all lowercase for element names • Always use closing tags • Empty elements are signified by a closing slash • Attribute values must be contained in quotation marks 25Web Design Principles 5th Ed.
  • 26. Sample XML <poem> <title>An Ode to the Web</title> <stanza> <line>So many Web sites</line> <line>So little time</line> <line>And all I want to do</line> <line>Is critique their design!</line> </stanza> </poem> 26Web Design Principles 5th Ed.
  • 27. XML and XHTML – A New Direction • XML syntax provides a solution to the problem of widely varying HTML coding standards • The W3C combined XML and HTML to create XHTML • XHTML follows the rules of XML • Web developers readily adopted XHTML and CSS to standardize coding • Many Web sites benefited from leaner standardized code 27Web Design Principles 5th Ed.
  • 28. Problems with XHTML • Relaxed syntax rules still must be applied because of legacy code • Newer versions of XHTML moved too far away from existing Web development • XHTML was not well received by the development community 28Web Design Principles 5th Ed.
  • 29. A Proposal for HTML5 • The Web Hypertext Application Technology Working Group (WHATWG) proposed HTML5 • HTML5: – Supports standards-based coding – Compatible with HTML and XHTML – Compatible with CSS – Supports new page layout elements – Application and media compatible 29Web Design Principles 5th Ed.
  • 31. Working with HTML5 • HTML5 attempts to address shortcomings of HTML • Addresses needs of modern Web design • Offers new features: – Logical layout elements – Rich media – Support for applications • Removes old features: – All display elements have been removed in favor of CSS – Framesets are gone 31Web Design Principles 5th Ed.
  • 32. Working with HTML5 HTML5 offers two syntaxes: – An HTML-compatible syntax – An XML-compatible syntax • HTML-compatible syntax – More relaxed syntax – Code shortcuts allowed • XML-compatible syntax – Consistent with XHTML – Uses XML syntax rules 32Web Design Principles 5th Ed.
  • 33. Working with HTML5 33Web Design Principles 5th Ed.
  • 34. Working with HTML5 34Web Design Principles 5th Ed.
  • 35. Choosing the Correct Syntax • HTML5 allows a mixture of these two types of syntax into one document • A polyglot document: mixed language • Use XML coding standards in your HTML documents • Lets you create standardized, compatible code 35Web Design Principles 5th Ed.
  • 36. Choosing the Correct doctype • Always use a doctype statement • Using a doctype forces the browser to display in standards mode • The standard doctype statement for HTML5: <!DOCTYPE html> 36Web Design Principles 5th Ed.
  • 37. Choosing the Correct MIME type • Multipurpose Internet Mail Extensions (MIME) defines content types for the Web • Determines the type of document • Declared in a <meta> element in the <head> section • Also contains a character set identifier • Your <meta> element should look like this: <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 37Web Design Principles 5th Ed.
  • 38. Creating Syntactically Correct Code • Documents must be well-formed • All tags must nest properly and not overlap • Use all lowercase for element names • Always use closing tags • Empty elements are marked with a closing slash • Attribute values must be contained in quotation marks 38Web Design Principles 5th Ed.
  • 39. HTML5 Element Categories • Metadata content • Flow content • Sectioning root • Sectioning content • Heading content • Phrasing content • Embedded content • Interactive content • Transparent 39Web Design Principles 5th Ed.
  • 40. New Elements in HTML5 • HTML5 has a number of new elements; see Table 1-2 in the text • Not all elements are supported by current browsers • Test new elements carefully 40Web Design Principles 5th Ed.
  • 41. Attributes in HTML5 • Elements can contain attributes that set properties • Earlier versions of HTML had more attributes • HTML5 has less attributes because of CSS • Global attributes can be applied to any element 41Web Design Principles 5th Ed.
  • 42. Obsolete Elements in HTML5 • Many elements have been removed in HTML, mostly involving presentation effects • Framesets are no longer available 42Web Design Principles 5th Ed.
  • 43. Using HTML5 Elements for Page Structure • Most Web pages contain common characteristics: – Header – Navigation – Articles – Figures – Footers – Sidebars • These are currently marked up with <div> elements and id or class names 43Web Design Principles 5th Ed.
  • 45. • HTML5 offers a new set of elements for describing document structure • HTML5 replaces the use of <div> with named elements to structure the page • The <article> element can be used instead of the <div> element, for example: <article>This is the main content of the Web page</article> Using HTML5 Elements for Page Structure 45Web Design Principles 5th Ed.
  • 46. Using HTML5 Elements for Page Structure • The HTML5 elements for page layout include: – <header> Contains the page header content – <nav> Contains the navigation elements for the page – <article> Contains the primary page content – <section> Defines sections or groupings of page content – <aside> Contains additional content such as a quote or sidebar – <figure> Contains images for the article content – <footer> Contains page footer content 46Web Design Principles 5th Ed.
  • 47. Interactive Capabilities in HTML5 • Audio and video • Drawing canvas • Background application processing • Local data storage 47Web Design Principles 5th Ed.
  • 49. Choosing an HTML Editor • Editors are either code-based or WYSIWYG (What You See is What You Get) • Some editors offer both methods • Many editors offer built-in code validators and FTP clients • You can find low-cost freeware or shareware editors • You can also use a text editor to create Web pages 49Web Design Principles 5th Ed.
  • 50. Choosing an HTML Editor • HTML editors contain their own logic for interpreting code • Make sure to check your work in multiple browsers • Some editors create overly complex code 50Web Design Principles 5th Ed.
  • 51. Using Good Coding Practices
  • 52. Using Good Coding Practices • Creating code that ensures the greatest standards- compliance, presentation, and usefulness of your content – Stick to the standards – Use semantic markup – Validate your code 52Web Design Principles 5th Ed.
  • 53. Stick to the Standards • Stick to the W3C standards • Separate content from presentation • Plan to be accessible to different devices • Standardized design is more accessible 53Web Design Principles 5th Ed.
  • 54. Use Semantic Markup • Semantic markup identifies the intended use of document sections • Accurately describes each piece of content • Until recently, this logical use of the HTML elements was largely ignored • Document elements match the meaning and usage of the document sections: <p> for paragraph, <h1> for top-level heading, and so on 54Web Design Principles 5th Ed.
  • 55. Validate Your Code • Valid code conforms to the usage rules of the W3C • The lack of valid code is a major problem • Valid code enhances browser compatibility, accessibility, and exchange of data • The most common mistakes include: – No doctype declaration – Missing closing tags – Missing alt attributes in <img> elements – Incorrect tag nesting – Unquoted attributes 55Web Design Principles 5th Ed.
  • 56. Migrating from Legacy HTML to HTML5 • The transition should be a gradual process • Clean up code on existing pages • Plan coding conventions for new pages, removing deprecated elements • Move display information to CSS • Test for backwards compatibility 56Web Design Principles 5th Ed.
  • 57. Summary • Make sure to check for support of new HTML5 elements, and test carefully before adding them to your Web site • Use the HTML5 naming conventions to name the content sections of your site even if only using them as class or id names • Use Cascading Style Sheets • Decide whether to code to the XML standard • Use good coding practices 57Web Design Principles 5th Ed.