You are on page 1of 67

New Perspectives on HTML 5 and CSS:

Comprehensive - eBook PDF


Visit to download the full and correct content document:
https://ebooksecure.com/download/new-perspectives-on-html-5-and-css-comprehensi
ve-ebook-pdf/
HTML 5 and
CSS

Australia • Brazil • Mexico • Singapore • United Kingdom • United States


This is an electronic version of the print textbook. Due to electronic rights restrictions,
some third party content may be suppressed. Editorial review has deemed that any suppressed
content does not materially affect the overall learning experience. The publisher reserves the right
to remove content from this title at any time if subsequent rights restrictions require it. For
valuable information on pricing, previous editions, changes to current editions, and alternate
formats, please visit www.cengage.com/highered to search by ISBN#, author, title, or keyword for
materials in your areas of interest.

Important Notice: Media content referenced within the product description or the product
text may not be available in the eBook version.
New Perspectives on HTML 5 and CSS, © 2021, 2017 Cengage Learning, Inc.
8th Edition Comprehensive Unless otherwise noted, all content is © Cengage.
Patrick Carey
WCN: 02-300
SVP, Higher Education Product Management:
ALL RIGHTS RESERVED. No part of this work covered by the copyright herein
Erin Joyner
may be reproduced or distributed in any form or by any means, except as
VP, Product Management: Mike Schenk permitted by U.S. copyright law, without the prior written permission of the
Product Director: Lauren Murphy copyright owner.
Product Team Manager: Kristin McNary
Product Assistant: Tom Benedetto For product information and technology assistance, contact us at
Cengage Customer & Sales Support, 1-800-354-9706 or
Director, Learning Design: Rebecca von Gillern support.cengage.com.
Senior Manager, Learning Design: Leigh Hefferon
For permission to use material from this text or product,
Learning Designer: Kate Mason submit all requests online at www.cengage.com/permissions.
Vice President, Marketing – Science, Technology,
& Math: Jason Sakos
Library of Congress Control Number: 2019940290
Senior Marketing Director: Michele McTighe
Marketing Manager: Cassie L Cloutier ISBN: 978-0-357-10714-0
Marketing Development Manager: Cengage
Samantha Best 200 Pier 4 Boulevard
Director, Content Creation: Juliet Steiner Boston, MA 02210
USA
Senior Manager, Content Creation: Patty Stephan
Content Manager: Christina Nyren Cengage is a leading provider of customized learning solutions with employees
Director, Digital Production Services: residing in nearly 40 different countries and sales in more than 125 countries
Krista Kellman around the world. Find your local representative at www.cengage.com.
Digital Delivery Lead: Justin Maniaci Cengage products are represented in Canada by Nelson Education, Ltd.
Technical Editors: John Freitas and Danielle Shaw
To learn more about Cengage platforms and services, register or access your
Developmental Editors: Deb Kaufmann and online learning solution, or purchase materials for your course, visit
Ann Shaffer www.cengage.com.
Production Service/Composition: Lumina
Datamatics Ltd.
Design Director: Jack Pendleton
Designer: Erin Griffin
Text Designer: Althea Chen
Cover Template Designer: Wing-Ip Ngan,
Ink Design, Inc.
Cover image(s): Mai Phongsook/ShutterStock.com

Notice to the Reader


Publisher does not warrant or guarantee any of the products described herein or perform any independent analysis in connection
with any of the product information contained herein. Publisher does not assume, and expressly disclaims, any obligation to
obtain and include information other than that provided to it by the manufacturer. The reader is expressly warned to consider and
adopt all safety precautions that might be indicated by the activities described herein and to avoid all potential hazards. By
following the instructions contained herein, the reader willingly assumes all risks in connection with such instructions. The
publisher makes no representations or warranties of any kind, including but not limited to, the warranties of fitness for particular
purpose or merchantability, nor are any such representations implied with respect to the material set forth herein, and the
publisher takes no responsibility with respect to such material. The publisher shall not be liable for any special, consequential, or
exemplary damages resulting, in whole or part, from the readers’ use of, or reliance upon, this material.

Printed in the United States of America


Print Number: 01   Print Year: 2019
Preface
The New Perspectives Series’ critical-thinking, problem-solving approach is the ideal way
to prepare students to transcend point-and-click skills and take advantage of all that
HTML 5 and CSS has to offer.
In developing the New Perspectives Series, our goal was to create books that give students
the software concepts and practical skills they need to succeed beyond the classroom. We’ve
updated our proven case-based pedagogy with more practical content to make learning
skills more meaningful to students. With the New Perspectives Series, students understand
why they are learning what they are learning, and are fully prepared to apply their skills to
real-life situations.

“I love this text


because it provides
About This Book
detailed instructions This book provides thorough coverage of HTML 5 and CSS, and includes the following:
and real-world
application examples.
• Up-to-date coverage of using HTML 5 to create structured websites
It is ideal for classroom • Instruction on the most current CSS styles to create visually-interesting pages and
and online instruction. captivating graphical designs
At the end of the term • Working with browser developer tools to aid in the creation and maintenance of
my students comment ­fully-functioning websites
on how much they’ve
learned and put to use New for this edition!
outside the classroom.” • Coverage of CSS grid styles for creating grid-based layouts.
—Customer at • Exploration of new CSS styles for filters and transformations.
St. Johns River • New hands-on demo pages to interactively explore HTML and CSS concepts.
Community College
• New coding challenges for each tutorial to focus on specific tasks and concepts.
• New debugging challenges for each tutorial to explore how to fix malfunctioning
websites.

System Requirements
This book assumes that students have an Internet connection, a text editor, and a current
browser that supports HTML 5 and CSS. The following is a list of the most recent versions of
the major browsers at the time this text was published: Internet Explorer 11, Microsoft
Edge 44, Firefox 66, Safari 12.1, Opera 60, and Google Chrome 75. More recent versions may
have come out since the publication of this book. Students should go to the web browser home
page to download the most current version. All browsers interpret HTML 5 and CSS code in
slightly different ways. It is highly recommended that students have several different browsers
installed on their systems for comparison and, if possible, access to a mobile browser or a
mobile emulator. Students might also want to run older versions of these browsers to highlight
compatibility issues. The screenshots in this book were produced using Google Chrome 75
­running on Windows 10 ­(64-bit), unless otherwise noted. If students are using different devices,
browsers, or operating systems, their screens might vary from those shown in the book; this
should not present any problems in completing the tutorials.

iii
iv New Perspectives Series

“New Perspectives texts


provide up-to-date,
The New Perspectives Approach
real-world application
of content, making Context
book selection easy. The Each tutorial begins with a problem presented in a “real-world” case that is meaningful to
step-by-step, hands-on ­students. The case sets the scene to help students understand what they will do in the tutorial.
approach teaches
students concepts they Hands-on Approach
can apply immediately.” Each tutorial is divided into manageable sessions that combine reading and hands-on, step-
—Customer at
Southeastern Technical by-step work. Colorful screenshots help guide students through the steps. Trouble? tips,
College which anticipate common mistakes or problems, help students stay on track and continue
with the tutorial.
VISUAL OVERVIEW
Visual Overviews
Each session begins with a Visual Overview, a two-page spread that includes colorful, enlarged
figures with numerous callouts and key term definitions, giving students a comprehensive
­preview of the topics covered in the session, as well as a handy study guide.

PROSK ILL S ProSkills Boxes


ProSkills boxes provide guidance for applying concepts to real-world, professional situations,
involving one or more of the following soft skills: decision making, problem solving, ­teamwork,
verbal communication, and written communication.

K E Y S TEP Key Steps


Important steps are highlighted in yellow with attached margin notes to help students pay close
attention to completing the steps correctly and avoid time-consuming rework.

INSIGHT InSight Boxes


InSight boxes offer expert advice and best practices to help students achieve a deeper under-
standing of the concepts behind the software features and skills.

Margin Tips
Margin Tips provide helpful hints and shortcuts for more efficient use of the software. The Tips
appear in the margin at key points throughout each tutorial, giving students extra information
when and where they need it.

TRY IT Try It tips point to demo pages provided with the data folder for interactive exploration of key
concepts.

REVIEW Assessment
Retention is a key component to learning. At the end of each session, a series of Quick Check
CODE multiple choice questions helps students test their understanding of the material before mov-
DEBUG ing on. New with this edition are Coding Challenges and debugging exercises that focus on a
few key challenges. Engaging end-of-tutorial Review Assignments and Case Problems have
APPLY
always been a hallmark feature of the New Perspectives Series. Colorful bars and brief descrip-
CHALLENGE tions accompany the exercises, making it easy to understand both the goal and level of chal-
CRE ATE lenge a particular assignment holds.

REFERENCE Reference
Within each tutorial, Reference boxes appear before a set of steps to provide a succinct
GLOSSARY/INDEX
summary or preview of how to perform a task. In addition, each book includes a combination
Glossary/Index to promote easy reference of material.
HTML 5 and CSS, 8th Edition, Comprehensive v

Level Color Scheme

Our Complete System of Instruction


Coverage To Meet Your Needs
Whether you’re looking for just a small amount of coverage or enough to fill a semester-long
class, we can provide you with a textbook that meets your needs.
• Introductory books contain an average of 5 to 8 tutorials and include essential skills
on the books concepts.
• Comprehensive books, which cover additional concepts and skills in depth, are great
for a full-semester class, and contain 9 to 12+ tutorials.
So, if you are looking for just the essential skills or more complete in-depth coverage of a
topic, we have an offering available to meet your needs. Go to our web site or contact your
Cengage sales representative to find out what else we offer.

MindTap
MindTap is a personalized learning experience with relevant assignments that guide students to
analyze, apply, and improve thinking, allowing you to measure skills and outcomes with ease.

For instructors: personalized teaching becomes yours with a Learning Path that is built with
key student objectives. Control what students see and when they see it. Use as-is, or match to
your syllabus exactly: hide, rearrange, add, or create your own content.

For students: a unique Learning Path of relevant readings, multimedia, and activities that guide
you through basic knowledge and comprehension to analysis and application.

Better outcomes: empower instructors and motivate students with analytics and reports that
provide a snapshot of class progress, time in course, engagement, and completion rates.

The MindTap for HTML 5 and CSS includes coding labs, study tools, and interactive ­quizzing,
all integrated into an eReader that includes the full content of the printed text.

Instructor Resources
We offer more than just a book. We have all the tools you need to enhance your lectures, check
students’ work, and generate exams in a new, easier-to-use and completely revised package. This
book’s Instructor’s Manual, Cognero testbank, PowerPoint presentations, data files, solution files,
figure files, and a sample syllabus are all available at sso.cengage.com.

Acknowledgments
I would like to thank the people who worked so hard to make this book possible. Special thanks
to my developmental editors, Deb Kaufmann and Ann Shaffer, for their hard work, attention
to detail, and valuable insights, and to Content Manager, Christina Nyren, who has worked tire-
lessly in overseeing this project and made my task so much easier with enthusiasm and good
humor. Other ­people at Cengage who deserve credit are Kristin McNary, Program Team Lead;
vi New Perspectives Series

Kate Mason, Learning Designer; Tom Benedetto, Product Assistant; Erin Griffin, Art Director;
Fola Orekoya, Manufacturing Planner; Lumina Datamatics Ltd., Compositor, as well as John
Freitas and Danielle Shaw, Technical Editors.

This book is dedicated to my wife Joan who is my inspiration and role model for her good
humor, dedication, and tireless support.
– Patrick Carey
HTML 5 and CSS, 8th Edition, Comprehensive vii

BRIEF CONTENTS
HTML Level I Tutorials
Tutorial 1 Getting Started with HTML 5. . . . . . . . . . . . . . . . . . . . . . . . . HTML 1
Creating a Website for a Food Vendor
Tutorial 2 Getting Started with CSS. . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 85
Designing a Website for a Fitness Club

Level II Tutorials
Tutorial 3 Designing a Page Layout . . . . . . . . . . . . . . . . . . . . . . . . . HTML 175
Creating a Website for a Chocolatier
Tutorial 4 Graphic Design with CSS . . . . . . . . . . . . . . . . . . . . . . . . . HTML 273
Creating a Graphic Design for a Genealogy Website
Tutorial 5 Designing for the Mobile Web. . . . . . . . . . . . . . . . . . . . . . HTML 361
Creating a Mobile Website for a Daycare Center

Level III Tutorials


Tutorial 6 Working with Tables and Columns. . . . . . . . . . . . . . . . . . . . HTML 451
Creating a Program Schedule for a Radio Station
Tutorial 7 Designing a Web Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 517
Creating a Survey Form
Tutorial 8 Enhancing a Website with Multimedia . . . . . . . . . . . . . . . . HTML 601
Working with Sound, Video, and Animation
Tutorial 9 Getting Started with JavaScript. . . . . . . . . . . . . . . . . . . . . HTML 681
Creating a Countdown Clock
Tutorial 10 Exploring Arrays, Loops, and Conditional Statements. . . . HTML 751
Creating a Monthly Calendar
Appendix A Color Names with Color Values, and HTML Character
Entities. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML A1
Appendix B HTML Elements and Attributes. . . . . . . . . . . . . . . . . . . . . HTML B1
Appendix C Cascading Styles and Selectors . . . . . . . . . . . . . . . . . . . . . HTML C1
Appendix D Making the Web More Accessible . . . . . . . . . . . . . . . . . . . HTML D1
Appendix E Designing for the Web. . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML E1
Appendix F Page Validation with XHTML . . . . . . . . . . . . . . . . . . . . . . HTML F1

Glossary REF 1

Index REF 11
viii New Perspectives Series

TABLE OF CONTENTS
Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii SESSION 1.2���������������������������������������������������������HTML 22

Writing the Page Body . . . . . . . . . . . . . . . . . . . . . . HTML 24


HTML LEVEL I TUTORIALS Using Sectioning Elements . . . . . . . . . . . . . . . . HTML 24
Tutorial 1 Getting Started with HTML 5 Comparing Sections in HTML 4 and HTML 5 . . HTML 26
Creating a Website for a Food Vendor . . . . . . . . . HTML 1
Using Grouping Elements . . . . . . . . . . . . . . . . . . HTML 26
SESSION 1.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 2
Using Text-Level Elements . . . . . . . . . . . . . . . . HTML 29
Exploring the World Wide Web . . . . . . . . . . . . . . . . HTML 4
Linking an HTML Document to a Style Sheet . . . . . HTML 32
Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 4
Working with Character Sets and Special
Locating Information on a Network . . . . . . . . . . . HTML 4 Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 33

Web Pages and Web Servers . . . . . . . . . . . . . . . . HTML 4 Character Encoding . . . . . . . . . . . . . . . . . . . . . . HTML 33

Introducing HTML . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 5 Character Entity References . . . . . . . . . . . . . . . HTML 34

The History of HTML . . . . . . . . . . . . . . . . . . . . . HTML 5 Working with Inline Images . . . . . . . . . . . . . . . . . . HTML 36

Tools for Working with HTML . . . . . . . . . . . . . . . . . HTML 6 Line Breaks and Other Empty Elements . . . . . . . HTML 38

Content Management Systems and Working with Block Quotes and Other Elements . . . HTML 39
Frameworks . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 7
Session 1.2 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 45
Testing your Code . . . . . . . . . . . . . . . . . . . . . . . . HTML 7
SESSION 1.3���������������������������������������������������������HTML 46
Exploring an HTML Document . . . . . . . . . . . . . . . . . HTML 8
Working with Lists . . . . . . . . . . . . . . . . . . . . . . . . . HTML 48
The Document Type Declaration . . . . . . . . . . . . . HTML 8
Ordered Lists . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 48
Introducing Element Tags . . . . . . . . . . . . . . . . . . HTML 9
Unordered Lists . . . . . . . . . . . . . . . . . . . . . . . . . HTML 49
The Element Hierarchy . . . . . . . . . . . . . . . . . . . HTML 10
Description Lists . . . . . . . . . . . . . . . . . . . . . . . . HTML 51
Introducing Element Attributes . . . . . . . . . . . . . HTML 11
Navigation Lists . . . . . . . . . . . . . . . . . . . . . . . . HTML 55
Handling White Space . . . . . . . . . . . . . . . . . . . . HTML 12
Working with Hypertext Links . . . . . . . . . . . . . . . . HTML 57
Viewing an HTML File in a Browser . . . . . . . . . HTML 12
Turning an Inline Image into a Link . . . . . . . . . . HTML 59
Creating an HTML File . . . . . . . . . . . . . . . . . . . HTML 13
Specifying the Folder Path . . . . . . . . . . . . . . . . . . . HTML 60
Creating the Document Head . . . . . . . . . . . . . . . . . HTML 15
Absolute Paths . . . . . . . . . . . . . . . . . . . . . . . . . HTML 61
Setting the Page Title . . . . . . . . . . . . . . . . . . . . HTML 16
Relative Paths . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 61
Adding Metadata to the Document . . . . . . . . . . HTML 16
Setting the Base Path . . . . . . . . . . . . . . . . . . . . HTML 62
Adding Comments to Your Document . . . . . . . . . . . HTML 18
Linking to a Location within a Document . . . . . . . . HTML 63
Session 1.1 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 21
HTML 5 and CSS, 8th Edition, Comprehensive ix

Marking Locations with the id Attribute . . . . . . . HTML 63 RGB Color Values . . . . . . . . . . . . . . . . . . . . . . . HTML 99

Linking to an id . . . . . . . . . . . . . . . . . . . . . . . . . HTML 63 HSL Color Values . . . . . . . . . . . . . . . . . . . . . . HTML 101

Anchors and the name Attribute . . . . . . . . . . . . HTML 63 Defining Semi-Opaque Colors . . . . . . . . . . . . . HTML 102

Linking to the Internet and Other Resources . . . . . . HTML 64 Setting Text and Background Colors . . . . . . . . HTML 102

Linking to a Web Resource . . . . . . . . . . . . . . . . HTML 64 Employing Progressive Enhancement . . . . . . . . . . HTML 106

Linking to an Email Address . . . . . . . . . . . . . . . HTML 65 Session 2.1 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 107

Linking to a Phone Number . . . . . . . . . . . . . . . . HTML 67


SESSION 2.2�������������������������������������������������������HTML 108
Working with Hypertext Attributes . . . . . . . . . . . . . HTML 68
Exploring Selector Patterns . . . . . . . . . . . . . . . . . HTML 110
Validating Your Website . . . . . . . . . . . . . . . . . . . . . HTML 69
Contextual Selectors . . . . . . . . . . . . . . . . . . . . HTML 110
Session 1.3 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 71
Attribute Selectors . . . . . . . . . . . . . . . . . . . . . HTML 113
Review Assignments . . . . . . . . . . . . . . . . . . . . . . . . HTML 76
Working with Fonts . . . . . . . . . . . . . . . . . . . . . . . HTML 117
Case Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 79
Choosing a Font . . . . . . . . . . . . . . . . . . . . . . . . HTML 117
Tutorial 2 Getting Started with CSS
Exploring Web Fonts . . . . . . . . . . . . . . . . . . . . . HTML 119
Designing a Website for a Fitness Club . . . . . . . HTML 85
The @font-face Rule . . . . . . . . . . . . . . . . . . . . HTML 120
SESSION 2.1 ��������������������������������������������������������HTML 86
Setting the Font Size . . . . . . . . . . . . . . . . . . . . . . HTML 123
Introducing CSS . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 88
Absolute Units . . . . . . . . . . . . . . . . . . . . . . . . . HTML 123
Types of Style Sheets . . . . . . . . . . . . . . . . . . . . HTML 88
Relative Units . . . . . . . . . . . . . . . . . . . . . . . . . HTML 123
Viewing a Page Using Different Style Sheets . . . HTML 89
Scaling Fonts with ems and rems . . . . . . . . . . . HTML 124
Exploring Style Rules . . . . . . . . . . . . . . . . . . . . . . . HTML 92
Using Viewport Units . . . . . . . . . . . . . . . . . . . . HTML 125
Browser Extensions . . . . . . . . . . . . . . . . . . . . . . HTML 92
Sizing Keywords . . . . . . . . . . . . . . . . . . . . . . . HTML 125
Embedded Style Sheets . . . . . . . . . . . . . . . . . . . HTML 93
Controlling Spacing and Indentation . . . . . . . . . . . HTML 127
Inline Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 93
Working with Font Styles . . . . . . . . . . . . . . . . . . . HTML 129
Style Specificity and Precedence . . . . . . . . . . . . HTML 94
Aligning Text Horizontally and Vertically . . . . . HTML 130
Style Inheritance . . . . . . . . . . . . . . . . . . . . . . . . HTML 94
Combining All Text Formatting in a
Browser Developer Tools . . . . . . . . . . . . . . . . . . HTML 95 Single Style . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 131

Creating a Style Sheet . . . . . . . . . . . . . . . . . . . . . . HTML 96 Session 2.2 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 133

Writing Style Comments . . . . . . . . . . . . . . . . . . HTML 96


SESSION 2.3 �����������������������������������������������������HTML 136
Defining the Character Encoding . . . . . . . . . . . . HTML 97
Formatting Lists . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 138
Importing Style Sheets . . . . . . . . . . . . . . . . . . . HTML 98
Choosing a List Style Type . . . . . . . . . . . . . . . . HTML 138
Working with Color in CSS . . . . . . . . . . . . . . . . . . . HTML 98
Creating an Outline Style . . . . . . . . . . . . . . . . . HTML 138
Color Names . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 98
x New Perspectives Series

Using Images for List Markers . . . . . . . . . . . . . . HTML 141 Working with Container Collapse . . . . . . . . . . . HTML 201

Setting the List Marker Position . . . . . . . . . . . HTML 142 Session 3.1 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 204

Working with Margins and Padding . . . . . . . . . . . HTML 143


SESSION 3.2�������������������������������������������������������HTML 206
Setting the Padding Space . . . . . . . . . . . . . . . HTML 144
Introducing Grid Layouts . . . . . . . . . . . . . . . . . . . HTML 208
Setting the Margin and the Border Spaces . . . . HTML 146
Overview of Grid-Based Layouts . . . . . . . . . . . HTML 208
Using Pseudo-Classes and Pseudo-Elements . . . . . HTML 149
Fixed and Fluid Grids . . . . . . . . . . . . . . . . . . . . HTML 209
Pseudo-Classes . . . . . . . . . . . . . . . . . . . . . . . . HTML 149
CSS Frameworks . . . . . . . . . . . . . . . . . . . . . . . HTML 210
Pseudo-classes for Hypertext . . . . . . . . . . . . . HTML 152
Introducing CSS Grids . . . . . . . . . . . . . . . . . . . . . HTML 210
Pseudo-Elements . . . . . . . . . . . . . . . . . . . . . . HTML 154
Creating a CSS Grid . . . . . . . . . . . . . . . . . . . . . . . HTML 213
Generating Content with CSS . . . . . . . . . . . . . . . . HTML 155
Working with Grid Rows and Columns . . . . . . . . . HTML 215
Displaying Attribute Values . . . . . . . . . . . . . . . HTML 156
Track Sizes with Fractional Units . . . . . . . . . . . HTML 217
Inserting Quotation Marks . . . . . . . . . . . . . . . . . . HTML 157
Repeating Columns and Rows . . . . . . . . . . . . . HTML 218
Validating Your Style Sheet . . . . . . . . . . . . . . . . . HTML 158
Applying a Grid Layout . . . . . . . . . . . . . . . . . . . HTML 219
Session 2.3 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 160
Outlining a Grid . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 221
Review Assignments . . . . . . . . . . . . . . . . . . . . . . . HTML 166
Placing Items within a Grid . . . . . . . . . . . . . . . . . HTML 223
Case Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 169
Placing Items by Row and Column . . . . . . . . . . HTML 224

HTML LEVEL II TUTORIALS Using the span Keyword . . . . . . . . . . . . . . . . . HTML 226

Placing Grid Items by Area . . . . . . . . . . . . . . . HTML 228


Tutorial 3 Designing a Page Layout
Creating a Website for a Chocolatier . . . . . . . HTML 175 Defining the Grid Gap . . . . . . . . . . . . . . . . . . . . . HTML 232

SESSION 3.1 �������������������������������������������������������HTML 176 Managing Space within a Grid . . . . . . . . . . . . . . . HTML 234

Introducing the display Style . . . . . . . . . . . . . . . . HTML 178 Alignment for a Single Grid Cell . . . . . . . . . . . HTML 235

Creating a Reset Style Sheet . . . . . . . . . . . . . . . . HTML 178 Aligning the Grid . . . . . . . . . . . . . . . . . . . . . . . HTML 235

Exploring Page Layout Designs . . . . . . . . . . . . . . HTML 182 Session 3.2 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 237

Fixed, Fluid, and Elastic Layouts . . . . . . . . . . . HTML 182 SESSION 3.3 ������������������������������������������������������HTML 238
Working with Width and Height . . . . . . . . . . . . . . HTML 184 Positioning Objects . . . . . . . . . . . . . . . . . . . . . . . . HTML 240
Setting Maximum and Minimum Dimensions . . HTML 184 The CSS Positioning Styles . . . . . . . . . . . . . . . HTML 240
Centering a Block Element . . . . . . . . . . . . . . . HTML 187 Relative Positioning . . . . . . . . . . . . . . . . . . . . . HTML 240
Vertical Centering . . . . . . . . . . . . . . . . . . . . . . HTML 188 Absolute Positioning . . . . . . . . . . . . . . . . . . . . HTML 241
Floating Page Content . . . . . . . . . . . . . . . . . . . . . HTML 189 Fixed and Inherited Positioning . . . . . . . . . . . . HTML 244
Clearing a Float . . . . . . . . . . . . . . . . . . . . . . . . HTML 193 Using the Positioning Styles . . . . . . . . . . . . . . . HTML 244
Refining a Floated Layout . . . . . . . . . . . . . . . . HTML 197
HTML 5 and CSS, 8th Edition, Comprehensive xi

Handling Overflow . . . . . . . . . . . . . . . . . . . . . . . . HTML 254 Gradients and Color Stops . . . . . . . . . . . . . . . . HTML 315

Clipping an Element . . . . . . . . . . . . . . . . . . . . . . . HTML 257 Creating a Radial Gradient . . . . . . . . . . . . . . . HTML 316

Stacking Elements . . . . . . . . . . . . . . . . . . . . . . . . HTML 258 Repeating a Gradient . . . . . . . . . . . . . . . . . . . . HTML 320

Session 3.3 Quick Check . . . . . . . . . . . . . . . . . . . HTML 260 Creating Semi-Transparent Objects . . . . . . . . . . . . HTML 322

Review Assignments . . . . . . . . . . . . . . . . . . . . . . . HTML 267 Session 4.2 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 324

Case Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 269


SESSION 4.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 326
Tutorial 4 Graphic Design with CSS
Transforming Page Objects . . . . . . . . . . . . . . . . . . HTML 328
Creating a Graphic Design for a
Genealogy Website . . . . . . . . . . . . . . . . . . . . . . HTML 273 Transformations in Three Dimensions . . . . . . . . HTML 332

Understanding Perspective . . . . . . . . . . . . . . . HTML 333


SESSION 4.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 274
Exploring CSS Filters . . . . . . . . . . . . . . . . . . . . . . HTML 337
Creating Figure Boxes . . . . . . . . . . . . . . . . . . . . . HTML 276
Working with Image Maps . . . . . . . . . . . . . . . . . . HTML 341
Exploring Background Styles . . . . . . . . . . . . . . . . HTML 280
Defining a Client-Side Image Map . . . . . . . . . . HTML 341
Tiling a Background Image . . . . . . . . . . . . . . . HTML 281
Applying an Image Map . . . . . . . . . . . . . . . . . . HTML 345
Attaching the Background Image . . . . . . . . . . . HTML 283
Session 4.3 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 347
Setting the Background Image Position . . . . . . HTML 283
Review Assignments . . . . . . . . . . . . . . . . . . . . . . HTML 354
Defining the Extent of the Background . . . . . . HTML 284
Case Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 357
Sizing and Clipping an Image . . . . . . . . . . . . . . HTML 285

The background Property . . . . . . . . . . . . . . . . HTML 286


Tutorial 5 Designing for the Mobile Web
Creating a Mobile Website for a Daycare Center . . HTML 361
Adding Multiple Backgrounds . . . . . . . . . . . . . HTML 288
SESSION 5.1 �������������������������������������������������������HTML 362
Working with Borders . . . . . . . . . . . . . . . . . . . . . HTML 290
Introducing Responsive Design . . . . . . . . . . . . . . . HTML 364
Setting Border Width and Color . . . . . . . . . . . HTML 290
Introducing Media Queries . . . . . . . . . . . . . . . . . . HTML 365
Setting the Border Design . . . . . . . . . . . . . . . . HTML 291
The @media Rule . . . . . . . . . . . . . . . . . . . . . . HTML 366
Creating Rounded Corners . . . . . . . . . . . . . . . . HTML 293
Media Queries and Device Features . . . . . . . . . HTML 367
Applying a Border Image . . . . . . . . . . . . . . . . . HTML 297
Applying Media Queries to a Style Sheet . . . . . HTML 369
Session 4.1 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 301
Exploring Viewports and Device Width . . . . . . . . . HTML 372
SESSION 4.2 ������������������������������������������������������HTML 302
Creating a Mobile Design . . . . . . . . . . . . . . . . . . . HTML 375
Creating Drop Shadows . . . . . . . . . . . . . . . . . . . . HTML 304
Creating a Pulldown Menu with CSS . . . . . . . . HTML 376
Creating a Text Shadow . . . . . . . . . . . . . . . . . . HTML 304
Testing Your Mobile Website . . . . . . . . . . . . . . HTML 379
Creating a Box Shadow . . . . . . . . . . . . . . . . . . HTML 306
Creating a Tablet Design . . . . . . . . . . . . . . . . . . . HTML 383
Applying a Color Gradient . . . . . . . . . . . . . . . . . . HTML 312
Creating a Desktop Design . . . . . . . . . . . . . . . . . . HTML 387
Creating a Linear Gradient . . . . . . . . . . . . . . . HTML 312
Session 5.1 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 391
xii New Perspectives Series

SESSION 5.2�������������������������������������������������������HTML 392 Session 5.3 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 437

Introducing Flexible Boxes . . . . . . . . . . . . . . . . . . HTML 394 Review Assignments . . . . . . . . . . . . . . . . . . . . . . . HTML 443

Defining a Flexible Box . . . . . . . . . . . . . . . . . . HTML 394 Case Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 446

Cross-Browser Flexboxes . . . . . . . . . . . . . . . . . HTML 395


HTML LEVEL III TUTORIALS
Setting the Flexbox Flow . . . . . . . . . . . . . . . . . HTML 395
Tutorial 6 Working with Tables and Columns
Working with Flex Items . . . . . . . . . . . . . . . . . . . HTML 397 Creating a Program Schedule for a Radio Station . . HTML 451
Setting the Flex Basis . . . . . . . . . . . . . . . . . . . HTML 397
SESSION 6.1�������������������������������������������������������HTML 452
Defining the Flex Growth . . . . . . . . . . . . . . . . . HTML 398
Introducing Web Tables . . . . . . . . . . . . . . . . . . . . HTML 454
Defining the Shrink Rate . . . . . . . . . . . . . . . . . HTML 399
Marking Tables and Table Rows . . . . . . . . . . . . HTML 454
The flex Property . . . . . . . . . . . . . . . . . . . . . . HTML 401
Marking Table Headings and Table Data . . . . . HTML 456
Applying a Flexbox Layout . . . . . . . . . . . . . . . HTML 402
Adding Table Borders with CSS . . . . . . . . . . . . . . HTML 459
Reordering Page Content with Flexboxes . . . . . . . HTML 407
Spanning Rows and Columns . . . . . . . . . . . . . . . . HTML 464
Exploring Flexbox Layouts . . . . . . . . . . . . . . . . . . HTML 409
Creating a Table Caption . . . . . . . . . . . . . . . . . . . HTML 471
Aligning Items along the Main Axis . . . . . . . . . HTML 409
Session 6.1 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 475
Aligning Flex Lines . . . . . . . . . . . . . . . . . . . . . HTML 410

Aligning Items along the Cross Axis . . . . . . . . . HTML 410 SESSION 6.2 �����������������������������������������������������HTML 476

Creating a Navicon Menu . . . . . . . . . . . . . . . . . . . HTML 412 Creating Row Groups . . . . . . . . . . . . . . . . . . . . . . HTML 478

Session 5.2 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 417 Creating Column Groups . . . . . . . . . . . . . . . . . . . . HTML 482

Exploring CSS Styles and Web Tables . . . . . . . . . HTML 485


SESSION 5.3�������������������������������������������������������HTML 418
Working with Width and Height . . . . . . . . . . . . HTML 486
Designing for Printed Media . . . . . . . . . . . . . . . . . HTML 420
Applying Table Styles to Other
Previewing the Print Version . . . . . . . . . . . . . . HTML 420 Page Elements . . . . . . . . . . . . . . . . . . . . . . . . HTML 490
Applying a Media Query for Printed Output . . . HTML 421 Tables and Responsive Design . . . . . . . . . . . . . . . . HTML 492
Working with the @page Rule . . . . . . . . . . . . . . . HTML 422 Designing a Column Layout . . . . . . . . . . . . . . . . . HTML 496
Setting the Page Size . . . . . . . . . . . . . . . . . . . HTML 423 Setting the Number of Columns . . . . . . . . . . . . HTML 496
Using the Page Pseudo-Classes . . . . . . . . . . . . HTML 423 Defining Columns Widths and Gaps . . . . . . . . . HTML 498
Page Names and the Page Property . . . . . . . . HTML 423 Managing Column Breaks . . . . . . . . . . . . . . . . HTML 501
Formatting Hypertext Links for Printing . . . . . HTML 428 Spanning Cell Columns . . . . . . . . . . . . . . . . . . HTML 503
Working with Page Breaks . . . . . . . . . . . . . . . . . . HTML 431 Session 6.2 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 505
Preventing Page Breaks . . . . . . . . . . . . . . . . . HTML 432 Review Assignments . . . . . . . . . . . . . . . . . . . . . . . HTML 510
Working with Widows and Orphans . . . . . . . . . HTML 434 Case Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 512
HTML 5 and CSS, 8th Edition, Comprehensive xiii

Tutorial 7 Designing a Web Form Creating a Range Slider . . . . . . . . . . . . . . . . . . HTML 566


Creating a Survey Form . . . . . . . . . . . . . . . . . . HTML 517
Suggesting Options with Data Lists . . . . . . . . . . . . HTML 569
SESSION 7.1 �������������������������������������������������������HTML 518 Working with Form Buttons . . . . . . . . . . . . . . . . . HTML 572
Introducing Web Forms . . . . . . . . . . . . . . . . . . . . HTML 520 Creating a Command Button . . . . . . . . . . . . . . HTML 572
Parts of a Web Form . . . . . . . . . . . . . . . . . . . . HTML 520 Creating Submit and Reset Buttons . . . . . . . . . HTML 572
Forms and Server-Based Programs . . . . . . . . . HTML 521 Designing a Custom Button . . . . . . . . . . . . . . . HTML 575
Starting a Web Form . . . . . . . . . . . . . . . . . . . . . . HTML 522 Validating a Web Form . . . . . . . . . . . . . . . . . . . . . HTML 575
Interacting with the Web Server . . . . . . . . . . . HTML 523 Identifying Required Values . . . . . . . . . . . . . . . HTML 575
Creating a Field Set . . . . . . . . . . . . . . . . . . . . . . . HTML 525 Validating Based on Data Type . . . . . . . . . . . . HTML 577
Marking a Field Set . . . . . . . . . . . . . . . . . . . . . HTML 525 Testing for a Valid Pattern . . . . . . . . . . . . . . . HTML 578
Adding a Field Set Legend . . . . . . . . . . . . . . . HTML 526 Defining the Length of the Field Value . . . . . . . HTML 580
Creating Input Boxes . . . . . . . . . . . . . . . . . . . . . . HTML 528 Applying Inline Validation . . . . . . . . . . . . . . . . . . . HTML 581
Input Types . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 528 Using the focus Pseudo-Class . . . . . . . . . . . . . . HTML 581
Input Types and Virtual Keyboards . . . . . . . . . HTML 531 Pseudo-Classes for Valid and Invalid Data . . . . HTML 583
Adding Field Labels . . . . . . . . . . . . . . . . . . . . . . . HTML 532 Session 7.3 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 586
Designing a Form Layout . . . . . . . . . . . . . . . . . . . HTML 534 Review Assignments . . . . . . . . . . . . . . . . . . . . . . . HTML 592
Defining Default Values and Placeholders . . . . . . . HTML 539 Case Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 595
Session 7.1 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 543 Tutorial 8 Enhancing a Website with Multimedia
Working with Sound, Video, and Animation . . . HTML 601
SESSION 7.2�������������������������������������������������������HTML 544
SESSION 8.1 ������������������������������������������������������HTML 602
Entering Date and Time Values . . . . . . . . . . . . . . HTML 546
Introducing Multimedia on the Web . . . . . . . . . . . HTML 604
Creating a Selection List . . . . . . . . . . . . . . . . . . . HTML 547
Understanding Codecs and Containers . . . . . . . HTML 604
Working with select Attributes . . . . . . . . . . . . . HTML 549
Understanding Plug-Ins . . . . . . . . . . . . . . . . . . HTML 605
Grouping Selection Options . . . . . . . . . . . . . . . HTML 551
Working with the audio Element . . . . . . . . . . . . . . HTML 607
Creating Option Buttons . . . . . . . . . . . . . . . . . . . . HTML 553
Browsers and Audio Formats . . . . . . . . . . . . . . HTML 607
Creating Check Boxes . . . . . . . . . . . . . . . . . . . . . . HTML 556
Applying Styles to the Media Player . . . . . . . . HTML 610
Creating a Text Area Box . . . . . . . . . . . . . . . . . . . HTML 558
Providing a Fallback to an Audio Clip . . . . . . . . HTML 613
Session 7.2 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 561
Exploring Embedded Objects . . . . . . . . . . . . . . . . HTML 615
SESSION 7.3 �������������������������������������������������������HTML 562
Plug-In Attributes . . . . . . . . . . . . . . . . . . . . . . HTML 615
Entering Numeric Data . . . . . . . . . . . . . . . . . . . . HTML 564
Plug-Ins as Fallback Options . . . . . . . . . . . . . . HTML 616
Creating a Spinner Control . . . . . . . . . . . . . . . HTML 564
Session 8.1 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 616
xiv New Perspectives Series

SESSION 8.2�������������������������������������������������������HTML 618 The Development of JavaScript . . . . . . . . . . . . HTML 685

Exploring Digital Video . . . . . . . . . . . . . . . . . . . . HTML 620 Working with the script Element . . . . . . . . . . . . . HTML 686

Video Formats and Codecs . . . . . . . . . . . . . . . HTML 620 Loading the script Element . . . . . . . . . . . . . . . HTML 686

Using the HTML 5 video Element . . . . . . . . . . . . . HTML 621 Inserting the script Element . . . . . . . . . . . . . . HTML 687

Adding a Text Track to Video . . . . . . . . . . . . . . . . HTML 624 Creating a JavaScript Program . . . . . . . . . . . . . . . HTML 689

Making Tracks with WebVTT . . . . . . . . . . . . . HTML 625 Adding Comments to your JavaScript Code . . . HTML 689

Placing the Cue Text . . . . . . . . . . . . . . . . . . . . HTML 628 Writing a JavaScript Command . . . . . . . . . . . . HTML 690

Applying Styles to Track Cues . . . . . . . . . . . . . HTML 630 Understanding JavaScript Syntax . . . . . . . . . . HTML 691

Using Third-Party Video Players . . . . . . . . . . . . . HTML 634 Debugging Your Code . . . . . . . . . . . . . . . . . . . . . . HTML 692

Exploring the Flash Player . . . . . . . . . . . . . . . HTML 635 Opening a Debugger . . . . . . . . . . . . . . . . . . . . HTML 692

Embedding Videos from YouTube . . . . . . . . . . . HTML 636 Inserting a Breakpoint . . . . . . . . . . . . . . . . . . . HTML 694

HTML 5 Video Players . . . . . . . . . . . . . . . . . . HTML 637 Applying Strict Usage of JavaScript . . . . . . . . . HTML 695

Session 8.2 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 639 Session 9.1 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 697

SESSION 8.3 �����������������������������������������������������HTML 640 SESSION 9.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 698

Creating Transitions with CSS . . . . . . . . . . . . . . . HTML 642 Introducing Objects . . . . . . . . . . . . . . . . . . . . . . . HTML 700

Introducing Transitions . . . . . . . . . . . . . . . . . . HTML 642 Object References . . . . . . . . . . . . . . . . . . . . . . HTML 701

Setting the Transition Timing . . . . . . . . . . . . . . HTML 644 Referencing Object Collections . . . . . . . . . . . . HTML 701

Delaying a Transition . . . . . . . . . . . . . . . . . . . . HTML 647 Referencing an Object by ID and Name . . . . . . HTML 703

Creating a Hover Transition . . . . . . . . . . . . . . . HTML 647 Changing Properties and Applying Methods . . . . . HTML 704

Animating Objects with CSS . . . . . . . . . . . . . . . . . HTML 652 Object Properties . . . . . . . . . . . . . . . . . . . . . . HTML 704

The @keyframes Rule . . . . . . . . . . . . . . . . . . . HTML 652 Applying a Method . . . . . . . . . . . . . . . . . . . . . HTML 704

Applying an Animation . . . . . . . . . . . . . . . . . . . HTML 655 Writing HTML Code . . . . . . . . . . . . . . . . . . . . . . . HTML 705

Controlling an Animation . . . . . . . . . . . . . . . . . HTML 658 Working with Variables . . . . . . . . . . . . . . . . . . . . HTML 709

Session 8.3 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 666 Declaring a Variable . . . . . . . . . . . . . . . . . . . . HTML 709

Review Assignments . . . . . . . . . . . . . . . . . . . . . . . HTML 673 Variables and Data Types . . . . . . . . . . . . . . . . HTML 710

Case Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 676 Using a Variable . . . . . . . . . . . . . . . . . . . . . . . HTML 711

Tutorial 9 Getting Started with JavaScript Working with Date Objects . . . . . . . . . . . . . . . . . . HTML 711
Creating a Countdown Clock . . . . . . . . . . . . . . . HTML 681
Creating a Date Object . . . . . . . . . . . . . . . . . . HTML 712
SESSION 9.1 �������������������������������������������������������HTML 682 Applying Date Methods . . . . . . . . . . . . . . . . . . HTML 713
Introducing JavaScript . . . . . . . . . . . . . . . . . . . . . HTML 684 Setting Date and Time Values . . . . . . . . . . . . . HTML 716
Server-Side and Client-Side Programming . . . . HTML 684 Session 9.2 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 717
HTML 5 and CSS, 8th Edition, Comprehensive xv

SESSION 9.3 �������������������������������������������������������HTML 718 Reversing an Array . . . . . . . . . . . . . . . . . . . . . HTML 763

Working with Operators and Operands . . . . . . . . . HTML 720 Sorting an Array . . . . . . . . . . . . . . . . . . . . . . . HTML 764

Using Assignment Operators . . . . . . . . . . . . . . HTML 720 Extracting and Inserting Array Items . . . . . . . . HTML 765

Calculating the Days Left in the Year . . . . . . . . HTML 721 Using Arrays as Data Stacks . . . . . . . . . . . . . . HTML 766

Working with the Math Object . . . . . . . . . . . . . . . HTML 723 Session 10.1 Quick Check . . . . . . . . . . . . . . . . . . . HTML 769

Using Math Methods . . . . . . . . . . . . . . . . . . . . HTML 723


SESSION 10.2 �������������������������������������������������� HTML 770
Using Math Constants . . . . . . . . . . . . . . . . . . . HTML 728
Working with Program Loops . . . . . . . . . . . . . . . . HTML 772
Working with JavaScript Functions . . . . . . . . . . . . HTML 730
Exploring the for Loop . . . . . . . . . . . . . . . . . . HTML 772
Calling a Function . . . . . . . . . . . . . . . . . . . . . . HTML 732
Exploring the while Loop . . . . . . . . . . . . . . . . . HTML 774
Creating a Function to Return a Value . . . . . . . HTML 733
Exploring the do/while Loop . . . . . . . . . . . . . . HTML 775
Running Timed Commands . . . . . . . . . . . . . . . . . . HTML 734
Comparison and Logical Operators . . . . . . . . . . . . HTML 776
Working with Time-Delayed Commands . . . . . . HTML 734
Program Loops and Arrays . . . . . . . . . . . . . . . . . . HTML 777
Running Commands at Specified Intervals . . . . HTML 734
Array Methods to Loop Through Arrays . . . . . . HTML 780
Controlling How JavaScript Works with
Running a Function for Each Array Item . . . . . HTML 781
Numeric Values . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 736
Mapping an Array . . . . . . . . . . . . . . . . . . . . . . HTML 781
Handling Illegal Operations . . . . . . . . . . . . . . . HTML 736
Filtering an Array . . . . . . . . . . . . . . . . . . . . . . HTML 782
Defining a Number Format . . . . . . . . . . . . . . . HTML 737
Session 10.2 Quick Check . . . . . . . . . . . . . . . . . . . HTML 785
Converting Between Numbers and Text . . . . . HTML 737

Session 9.3 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 739 SESSION 10.3 . . . . . . . . . . . . . . . . . . . . . . . . . HTML 786
Review Assignments . . . . . . . . . . . . . . . . . . . . . . . HTML 744 Introducing Conditional Statements . . . . . . . . . . . HTML 788
Case Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 746 Exploring the if Statement . . . . . . . . . . . . . . . HTML 789

Tutorial 10 Exploring Arrays, Loops, and Conditional Nesting if Statements . . . . . . . . . . . . . . . . . . . HTML 791
Statements Exploring the if else Statement . . . . . . . . . . . . HTML 793
Creating a Monthly Calendar . . . . . . . . . . . . . . HTML 751
Using Multiple else if Statements . . . . . . . . . . HTML 794
SESSION 10.1 . . . . . . . . . . . . . . . . . . . . . . . . . HTML 752
Completing the Calendar App . . . . . . . . . . . . . . . . HTML 796
Introducing the Monthly Calendar . . . . . . . . . . . . HTML 754
Setting the First Day of the Month . . . . . . . . . HTML 797
Reviewing the Calendar Structure . . . . . . . . . . HTML 755
Placing the First Day of the Month . . . . . . . . . HTML 798
Adding the calendar() Function . . . . . . . . . . . . HTML 756
Writing the Calendar Days . . . . . . . . . . . . . . . . HTML 799
Introducing Arrays . . . . . . . . . . . . . . . . . . . . . . . . HTML 757
Highlighting the Current Date . . . . . . . . . . . . . HTML 801
Creating and Populating an Array . . . . . . . . . . HTML 758
Displaying Daily Events . . . . . . . . . . . . . . . . . . HTML 803
Working with Array Length . . . . . . . . . . . . . . . HTML 761
xvi New Perspectives Series

Managing Program Loops and Conditional Appendix C Cascading Styles and Selectors . . HTML C1
Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 806
Appendix D Making the Web
Exploring the break Command . . . . . . . . . . . . . HTML 806
More Accessible. . . . . . . . . . . . . . . . . . . . . . . . HTML D1
Exploring the continue Command . . . . . . . . . . HTML 806
Appendix E Designing for the Web. . . . . . . . . . HTML E1
Exploring Statement Labels . . . . . . . . . . . . . . HTML 807
Appendix F Page Validation with XHTML. . . . HTML F1
Session 10.3 Quick Check . . . . . . . . . . . . . . . . . . . HTML 809
GLOSSARY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .REF 1
Review Assignments . . . . . . . . . . . . . . . . . . . . . . . HTML 815

Case Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 817 INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . REF 11

Appendix A Color Names with Color Values,


and HTML Character Entities . . . . . . . . . . . . . HTML A1

Appendix B HTML Elements and Attributes. . . HTML B1


TUTORIAL
1
O B J E C T I VES Getting Started
Session 1.1
• Explore the history of the web
• Create the structure of an
with HTML 5
HTML document Creating a Website for a Food Vendor
• Insert HTML elements and
attributes
• Insert metadata into a document
• Define a page title Case | Curbside Thai
Session 1.2 Sajja Adulet is the owner and master chef of Curbside Thai,
• Mark page structures with a restaurant owner and now food truck vendor in Charlotte,
sectioning elements North Carolina that specializes in Thai dishes. Sajja has hired
• Organize page content with you to develop the company’s website. The website will display
grouping elements information about Curbside Thai, including the truck’s daily
• Mark content with text-level locations, menu, catering opportunities, and contact information.
elements Sajja wants the pages to convey the message that customers will get
• Insert inline images the same great food and service whether they order in the restaurant
• Insert symbols based on
or from the food truck. Some of the materials for these pages have
character codes
already been completed by a former employee and Sajja needs you
Session 1.3 to finish the job by converting that work into a collection of web
• Mark content using lists page documents. To complete this task, you’ll learn how to write
• Create a navigation list and edit HTML 5 code and how to get your HTML files ready for
• Link to files within a website display on the World Wide Web.
with hypertext links
• Link to email addresses and
telephone numbers

STARTING DATA FILES

html01 tutorial review code1

ct_catering_txt.html mp_catering_txt.html code1-1_txt.html


ct_contact_txt.html mp_events_txt.html
ct_locations_txt.html mp_index_txt.html
ct_menu_txt.html mp_menu_txt.html + 5 files
ct_reviews._txt.html + 16 files

code2 code3 code4

code1-2_txt.html code1-3_txt.html + 7 files code1-4_txt.html + 2 files

case1 case2 demo

jtc_index_txt.html dr_faq_txt.html demo_characters.html


jtc_services_txt.html dr_index_txt.html demo_html.html
+ 6 files dr_info_txt.html + 9 files + 3 files
HTML 1
HTML 2 HTML 5 and CSS | Tutorial 1 Getting Started with HTML 5

Session 1.1 Visual Overview:


The document type
declaration is a processing The <html> tag
instruction indicating the marks the
markup language used in beginning of the
the document. HTML document.

The <head> tag marks


the document head
containing information An HTML comment is a
about the document. descriptive note added
to the HTML file.
The <meta> tag marks
metadata containing The <title> tag marks
information about the the page title that
document. appears on the browser
title bar or browser tab.

The <body> tag marks


the document body
containing all of the
content that will
appear in the page.

An opening tag marks


the start of the element
content; this tag marks
the start of page footer.

© Kzenon/Shutterstock.com;
A closing tag marks the © martiapunts/Shutterstock.com;
end of the element © Brian A Jackson/Shutterstock.com;
content; this tag marks the © sayhmog/Shutterstock.com;
end of the page footer. © rangizzz/Shutterstock.com
Tutorial 1 Getting Started with HTML 5 | HTML 5 and CSS HTML 3

The Structure of an HTML Document


Document as it appears
in the browser.

The exact layout of the


document elements is
determined by a style
sheet and not by the
document markup.

Kzenon/Shutterstock.com; © Courtesy Patrick Carey; martiapunts/Shutterstock.


com; Brian A Jackson/Shutterstock.com; A Studios/Shutterstock.com; rangizzz/
Shutterstock.com
HTML 4 HTML 5 and CSS | Tutorial 1 Getting Started with HTML 5

Exploring the World Wide Web


It is no exaggeration to say that the World Wide Web has had as profound an effect on
human communication as the printing press. One key difference is that operation of the
printing press was limited to a few select tradesmen but on the web everyone can be a
publisher of a website. Before creating your first website, you’ll examine a short history
of the web because that history impacts the way you write code for your web pages.
You’ll start by exploring the basic terminology of computer networks.

Networks
A network is a structure in which information and services are shared among devices
known as nodes or hosts. A host can be any device that is capable of sending or
receiving data electronically. The most common hosts that you will work with are
desktop computers, laptops, tablets, mobile phones, and printers.
A host that provides information or a service to other devices on the network is
called a server. For example, a print server provides printing services; a file server
provides storage space for saving and retrieving files. The device receiving these
services is called a client. A common network design is the client-server network,
in which the clients access information provided by one or more servers.
Networks are classified based on the range of devices they cover. A network
confined to a small geographic area, such as within a building or department, is
referred to as a local area network or LAN. A network that covers a wider area, such as
several buildings or cities, is called a wide area network or WAN. Wide area networks
typically consist of two or more interconnected local area networks. The largest WAN
in existence is the Internet, which incorporates an almost uncountable number of
networks and hosts involving computers, mobile devices (such as phones, tablets, and
so forth), MP3 players, and gaming systems.

Locating Information on a Network


The biggest obstacle to effectively using the Internet is the network’s sheer scope and
size. Most of the early Internet tools required users to master a bewildering array of
terms, acronyms, and commands. Because network users had to be well versed in
computers and network technology, Internet use was largely limited to programmers
and computer specialists working for universities, large businesses, and the
government.
The solution to this problem was developed in 1989 by Timothy Berners-Lee and
other researchers at the CERN nuclear research facility near Geneva, Switzerland.
They needed an information system that would make it easy for their researchers to
locate and share data on the CERN network, and so developed a system of hypertext
documents. Hypertext is a method of organization in which data sources are
interconnected through a series of links or hyperlinks activated to jump from one data
source to another. Hypertext is ideally suited for the Internet because end users don’t
need to know where a service is located—they only need to know how to activate
the link. The effectiveness of this technique quickly spread beyond Geneva and was
adopted across the Internet. The totality of these interconnected hypertext documents
became known as the World Wide Web. The fact that the Internet and the World
Wide Web are synonymous in many users’ minds is a testament to the success of the
hypertext approach.

Web Pages and Web Servers


Documents on the web are stored on web servers in the form of web pages and
accessed through a software program called a web browser. The browser retrieves the
Tutorial 1 Getting Started with HTML 5 | HTML 5 and CSS HTML 5

document from the web server and renders it in a form readable on a client device.
However, because there is a wide selection of client devices ranging from desktop
computers to mobile phones to screen readers that relay data aurally, each web page
must be written in code that is compatible with every device. How does the same
document work with so many different devices? To understand, you need to look at
how web pages are created.

Introducing HTML
A web page is a simple text file written in HTML (Hypertext Markup Language). You’ve
already read about hypertext, but what is a markup language? A markup language is
a language that describes the content and structure of a document by “marking up”
or tagging, different document elements. For example, this tutorial contains several
document elements such as the tutorial title, main headings, subheadings, paragraphs,
figures, figure captions, and so forth. Using a markup language, each of these elements
could be tagged as a distinct item within the “tutorial document.” Thus, a Hypertext
Markup Language is a language that supports tagging distinct document elements and
connecting documents through hypertext links.

The History of HTML


In the early years, no single organization defined the rules or syntax of HTML. Browser
developers were free to define and modify the language in different ways that, of
course, led to problems as different browsers supported different “flavors” of HTML
and a web page that was written based on one browser’s standard might appear totally
different when rendered by another browser. Ultimately, a group of web designers
and programmers called the World Wide Web Consortium, or the W3C, settled on
a set of standards or specifications for all browser manufacturers to follow. The W3C
has no enforcement power, but, because using a uniform language is in everyone’s
best interest, the W3C’s recommendations are usually followed, though not always
immediately. Each new version of HTML goes through years of discussion and testing
before it is formally adopted as the accepted standard. For more information on the
W3C and its services, see its website at www.w3.org.
By 1999, HTML had progressed to the fourth version of the language, HTML 4.01,
which provided support for multimedia, online commerce, and interactive scripts
running within the web page. However, there were still many incompatibilities in
how HTML was implemented across different browsers and how HTML code was
written by web developers. The W3C sought to take control of what had been a
haphazard process and enforce a stricter set of standards in a different version of
the language called XHTML (Extensible Hypertext Markup Language). By 2002, the
W3C had released the specifications for XHTML 1.1. But XHTML 1.1 was intended to
be only a minor upgrade on the way to XHTML 2.0, which would correct many of the
deficiencies found in HTML 4.01 and become the future language of the web. One
problem was that XHTML 2.0 would not be backward compatible with HTML and, as a
result, older websites could not be easily brought into the new standard.
Web designers rebelled at this development and, in response, the Web Hypertext
Application Technology Working Group (WHATWG) was formed in 2004 with the
mission to develop a rival version to XHTML 2.0, called HTML 5. Unlike XHTML 2.0,
HTML 5 would be compatible with earlier versions of HTML and would not apply the
same strict standards that XHTML demanded. For several years, it was unclear which
specification would win out; but by 2006, work on XHTML 2.0 had completely stalled
and the W3C issued a new charter for WHATWG to develop HTML 5 as the de facto
standard for the next generation of HTML. You can learn more about WHATWG and its
current projects at www.whatwg.org. The current version of HTML is HTML 5.2, which
achieved Recommendation status in 2017.
HTML 6 HTML 5 and CSS | Tutorial 1 Getting Started with HTML 5

As HTML has evolved, features and code found in earlier versions of the language
are often deprecated, or phased out, and while deprecated features might not be part
You can find out which
browsers support the of HTML 5, that doesn’t mean that you won’t encounter them in your work—indeed, if
features of HTML 5 by you are maintaining older websites, you will often need to interpret code from earlier
going to the website versions of HTML. Moreover, there are still many older browsers and devices in active
caniuse.com. use that do not support HTML 5. Thus, a major challenge for website designers is
writing code that takes advantage of HTML 5 but is still accessible to older technology.
Figure 1–1 summarizes some of the different versions of HTML that have been
implemented over the years. You can read detailed specifications for these versions at
the W3C website.

Figure 1–1 HTML version history

Version Date Description


HTML 1.0 1989 The first public version of HTML
HTML 2.0 1995 HTML version that added interactive elements including web
forms
HTML 3.2 1997 HTML version that provided additional support for web
tables and expanded the options for interactive form
elements and a scripting language
HTML 4.01 1999 HTML version that added support for style sheets to
give web designers greater control over page layout and
appearance, and provided support for multimedia elements
such as audio and video
XHTML 1.0 2001 A reformulation of HTML 4.01 using the XML markup
language in order to provide enforceable standards for
HTML content and to allow HTML to interact with other XML
languages
XHTML 2.0 discontinued in 2009 The follow-up version to XHTML 1.1 designed to fix some of
the problems inherent in HTML 4.01 syntax
HTML 5.0 2012 HTML version providing support for mobile design, semantic
page elements, column layout, form validation, offline
storage, and enhanced multimedia
HTML 5.2 2017 The current version of HTML 5

This book focuses on HTML 5, but you will also review some of the specifications
for HTML 4.01 and XHTML 1.1. Deprecated features from older versions of HTML will
be noted as such in the text.

Tools for Working with HTML


Because HTML documents are simple text files, the first tool you will need is a text
editor. You can use a basic text editor such as Windows Notepad or TextEdit for the
Macintosh, but it is highly recommended that you use one of the many inexpensive
editors that provide built-in support for HTML. These editors include syntax checking
to weed out errors and automatic insertion of HTML code. Some of the more popular
HTML editors are Notepad++ (notepad-plus-plus.org), Eclipse (www.eclipse.org), and
CoffeeCup (www.coffeecup.com).
These enhanced editors are a good way to start learning HTML and they will be all
you need for most basic projects, but professional web developers working on large
websites will quickly gravitate toward using a web IDE (Integrated Development
Environment), which is a software package providing comprehensive coverage of all
Tutorial 1 Getting Started with HTML 5 | HTML 5 and CSS HTML 7

phases of the development process from writing HTML code to creating scripts for
programs running on web servers. Some of the popular IDEs for web development
include Adobe Dreamweaver (www.adobe.com), Aptana Studio (www.aptana.com),
NetBeans IDE (netbeans.org), and Komodo IDE (komodoide.com). Web IDEs can be
very expensive, but most software companies will provide a free evaluation period for
you to test their product to see if it meets your needs.

Content Management Systems and Frameworks


You can also invest in a web content management system (wcms) which provides
authoring tools for website content and administration. Management systems provide
prepackaged templates so that users can get websites up and running with only a
minimal knowledge of HTML. Popular content management systems include WordPress
(www.wordpress.org), Joomla (www.joomla.org), and Drupal (www.drupal.org).
Content management systems are not without drawbacks. A wcms can be expensive
to maintain and put extra load on server resources. In addition, the templates and
authoring tools can be difficult to modify if they don’t exactly meet your needs.
A website usually involves the integration of many technologies and languages
beyond HTML, including databases for storing and retrieving data and programs
running on the web server for managing electronic commerce and communication.
Managing all those technologies is the job of a web framework that provides the
foundation of the design and deployment of web applications. Popular frameworks
include Ruby on Rails (rubyonrails.org), ASP.NET (www.asp.net), AngularJS (angularjs.org),
and Django (www.djangoproject.com).
Choosing among all these tools might seem intimidating to you. The bottom line is
that no matter what tools you use, the final code for the website is written in HTML. So,
even if that code is generated by a framework or content management system, you still
need to understand HTML to effectively manage your website. In this book, we’ll try to
keep things as simple as possible: just you, a text editor, and a web browser creating a
foundation for future study.

Testing your Code


Once you’ve written your code, you can test whether your HTML code employs proper
You can analyze syntax and structure by validating it at the W3C validation website (validator.w3.org).
each browser for its Validators, like the one available through the W3C website, are programs that test code
compatibility with to ensure that it contains no syntax errors. The W3C validator will highlight all of the
HTML 5 at the website syntax errors in your document with suggestions about how to fix those errors.
www.html5test.com.
Finally, you’ll need to test it to ensure that your content is rendered correctly.
You should test your code under a variety of screen resolutions, on several different
browsers and, if possible, on different versions of the same browser because users are
not always quick to upgrade their browsers. What may look good on a widescreen
monitor might look horrible on a mobile phone. At a minimum you should test your
website using the following popular browsers: Google Chrome, Internet Explorer, Apple
Safari, Mozilla Firefox, and Opera.
It is not always possible to load multiple versions of the same browser on
one computer, so, in order to test a website against multiple browser versions,
professional designers will upload their code to online testing services that report
on the website’s compatibility across a wide range of browsers, screen resolutions,
and devices, including both desktop and mobile devices. Among the popular
testing services are BrowserStack (www.browserstack.com), CrossBrowserTesting
(www.crossbrowsertesting.com), and Browsera (www.browsera.com). Most of these
sites charge a monthly connection fee with a limited number of testing minutes, so you
should not upload your code until you are past the initial stages of development.
HTML 8 HTML 5 and CSS | Tutorial 1 Getting Started with HTML 5

Exploring an HTML Document


Now that you have reviewed the history of the web and some of the challenges in
developing your own website, you will look at the code of an actual HTML file. To get
you started, Sajja Adulet has provided you with the ct_start.html file containing the
code for the initial page users see when they access the Curbside Thai website. Open
Sajja’s file now.

To open the ct_start.html file:


w 1. Use the editor of your choice to open the ct_start.html file from the html01 c
All HTML files have the file tutorial folder.
extension .html or .htm.
Figure 1–2 shows the complete contents of the file as viewed in the
Notepad++ editor.

Figure 1–2 Elements and attributes from an HTML document

two-sided tag
enclosing element
content

empty elements,
which do not
contain content
an element attribute

several elements
nested within
another element

Trouble? Depending on your editor and its configuration, the text style
applied to your code might not match that shown in Figure 1–2. This is not a
problem. Because HTML documents are simple text files, any text styles are
a feature of the editor and have no impact on how the document is rendered
by the browser.
w 2. Scroll through the document to become familiar with its content but do not
make any changes to the text.

The Document Type Declaration


The first line in an HTML file is the document type declaration or doctype, which
is a processing instruction indicating the markup language used in the document.
The browser uses the document type declaration to know which standard to use for
displaying the content. For HTML 5, the doctype is entered as
<!DOCTYPE html>
Tutorial 1 Getting Started with HTML 5 | HTML 5 and CSS HTML 9

You might also see the doctype entered in lowercase letters as


<!doctype html>

Both are accepted by all browsers. Older versions of HTML had more complicated
doctypes. For example, the doctype for HTML 4.01 is the rather foreboding
<!
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

You might even come across older HTML files that do not have a doctype. Because
early versions of HTML did not require a doctype, many browsers interpret the
absence of the doctype as a signal that the page should be rendered in quirks mode,
based on styles and practices from the 1990s and early 2000s. When the doctype is
present, browsers will render the page in standards mode, employing the most current
specifications of HTML. The difference between quirks mode and standards mode can
mean the difference between a nicely laid-out page and a confusing mess, so always
put your HTML 5 file in standards mode by including the doctype.

Introducing Element Tags


The fundamental building block in every HTML document is the element tag, which
marks an element in the document. A starting tag indicates the beginning of that
element, while an ending tag indicates the ending. The general syntax of a two-sided
element tag is
<element>content</element>

where element is the name of the element, content is the element’s content,
<element> is the starting tag, and </element> is the ending tag. The following code
marks a paragraph element enclosed within the <p> and </p> tags:
<p>Welcome to Curbside Thai.</p>

The <p></p> tags indicate the presence of a paragraph and the text Welcome to
Curbside Thai. comprises the paragraph text.
Not every element tag encloses document content. Empty elements are elements
that are either nontextual (such as images) or contain directives to the browser about
how the page should be treated. An empty element is entered using one of the
following forms of the one-sided element tag:
<element />

or
<element>

The following br element indicates the presence of a line break in the text, and thus
does not contain any content:
<br />

Note that, while this code could also be entered as <br>, the ending slash /> form is
required in XHTML documents as well as other markup languages. While HTML 5
allows for either form, it’s a good idea to get accustomed to using the ending slash
/> form if you intend to work with other markup languages. We’ll follow the />
convention in the code in this book.
Elements can contain other elements, which are called nested elements. In the
following code, the em element (used to mark emphasized text) is nested within the
paragraph element by placing the <em> tag completely within the <p> tag.
HTML 10 HTML 5 and CSS | Tutorial 1 Getting Started with HTML 5

Proper syntax:
<p>Welcome to <em>Curbside Thai</em>.</p>

When nesting one element inside of another, the entire code of the inner element
must be contained within the outer element, including opening and closing tags. Thus,
it would not be correct to place the closing tag for the em element outside of the p
element as in the following code:

Improper syntax:
<p>Welcome to <em>Curbside Thai</p>.</em>

Now that you’ve examined the basics of tags, you’ll examine at how they’re organized
within an HTML file.

The Element Hierarchy


The entire structure of an HTML document can be thought of as a set of nested
elements in a hierarchical tree. At the top of the tree is the html element marking the
entire document. Within the html element is the head element enclosing information
about the document itself and the body element enclosing the content of the web page.
Thus, the general structure of an HTML file, like the one shown in Figure 1–2, is
<!DOCTYPE html>
<html>
<head>
head content
</head>

<body>
body content
</body>
</html>

where head content and body content are nested elements placed within the
document head and body. Note that the body element is always placed after the head
element.

Creating the Basic Structure of an HTML File


REFERENCE

• To create the basic structure of an HTML file, enter the tags


<!DOCTYPE html>
<html>
<head>
head content
</head>

<body>
body content
</body>
</html>

where head, content, and body content contain nested elements that mark the
content of the head and body sections.
Tutorial 1 Getting Started with HTML 5 | HTML 5 and CSS HTML 11

Introducing Element Attributes


Elements often contain one or more element attributes providing additional
Attributes can be listed in information about the purpose of the element or how the element should be handled
any order but they must by the browser. The general syntax of an element attribute within a two-sided tag is
come after the element
name and be separated <element attr1="value1" attr2="value2" …>
from each other by a blank content
space; each attribute value </element>
must be enclosed within
single or double quotation Or, for a one-sided tag
marks.
<element attr1="value1" attr2="value2" … />

where attr1, attr2, and so forth are attributes associated with element and value1,
value2, and so forth are the corresponding attribute values. For example, the following
code adds the id attribute with the value "intro" to the <p> tag in order to identify the
paragraph as an introductory paragraph.
<p id="intro">Welcome to Curbside Thai.</p>

Each element has its own set of attributes but, in addition to these element-specific
attributes, there is a core set of attributes that can be applied to almost every HTML
element. Figure 1–3 lists some of the most commonly used core attributes; others are
listed in Appendix B.

Figure 1–3 Commonly used core HTML attributes

Attribute Description
class="text" Defines the general classification of the element
dir="ltr|rtl|auto" Defines the text direction of the element content as left-to-right,
right-to-left, or determined by the browser
hidden Indicates that the element should be hidden or is no longer
relevant
id="text" Provides a unique identifier for the element
lang="text" Specifies the language of the element content
style="definition" Defines the style or appearance of the element content
tabindex="integer" Specifies the tab order of the element (when the tab button is
used to navigate the page)
title="text" Assigns a title to the element content

For attributes that do not require a value, HTML supports attribute minimization by
removing the attribute value completely. For example, the hidden attribute used in the
following code does not require a value; its mere presence indicates that the marked
paragraph should be hidden in the rendered page.
<p hidden>Placeholder Text</p>

Attribute minimization is another example of how HTML 5 differs from other


markup languages such as XHTML in which minimization is not allowed and all
attributes must have attribute values.
HTML 12 HTML 5 and CSS | Tutorial 1 Getting Started with HTML 5

Adding an Attribute to an Element

REFERENCE
• To add an attribute to an element, enter
<element attr1="value1" attr2="value2" …>
content
</element>

where attr1, attr2, and so forth are HTML attributes associated with element and
value1, value2, and so forth are the corresponding attribute values.

Handling White Space


An HTML file is composed only of text characters and white-space characters. A white-
space character is any empty or blank character such as a space, tab, or line break.
The browser reading the HTML code ignores the presence of white-space characters
between element tags and makes no distinction between spaces, tabs, or line breaks.
Thus, a browser will treat the following two pieces of code the same:
<p>Welcome to <em>Curbside Thai</em>.</p>

and
<p>
Welcome to <em>Curbside Thai</em>.
</p>

The browser also collapses consecutive occurrences of white-space characters into a


single occurrence, so that the text of the paragraph in the following code is still treated
as “Welcome to Curbside Thai”, ignoring the extra white spaces between “Curbside”
and “Thai”.
<p>
Welcome to <em>Curbside Thai</em>.
</p>

The bottom line is that it doesn’t matter how you lay out your HTML code because
the browser is only interested in the text content and not how that text is entered. This
means you can make your file easier to read by indenting lines and by adding extra
white-space characters to separate one code block from another. However, this also
means that any formatting you do for the page text to make the code more readable,
such as tabs or extra white spaces, is not transferred to the web page.

Viewing an HTML File in a Browser


The structure of the HTML file shown in Figure 1–2 should now be a little clearer, even
if you don’t yet know how to interpret the meaning and purpose of each of element and
attribute. To see what this page looks like, open it within a web browser.

To open the ct_start.html file in a web browser:


w 1. Open your web browser. You do not need to be connected to the Internet to
view local files stored on your computer.
w 2. After your browser loads its home page, open the ct_start.html file from the
html01 c tutorial folder. Figure 1–4 shows the page as it appears on a mobile
phone and on a tablet device. The two devices have different screen widths,
which affects how the page is rendered.
Tutorial 1 Getting Started with HTML 5 | HTML 5 and CSS HTML 13

Figure 1–4 The Curbside Thai starting page as rendered by a mobile and tablet device

© Brian A Jackson/Shutterstock.com; © sayhmog/Shutterstock.com;


© Kzenon/Shutterstock.com; © martiapunts/Shutterstock.com;

© rangizzz/Shutterstock.com; BenBois/openclipart;
Jmlevick/openclipart
mobile device tablet device

Trouble? If you’re not sure how to open a local file with your browser, check
for an Open or Open File command under the browser’s File menu. You
can also open a file by double-clicking the file name from within Windows
Explorer or Apple Finder.
w 3. Reduce the width of your browser window and note that when the width
falls below a certain value (in this case 480 pixels), the layout automatically
changes to a stacked row of images (as shown in the mobile device image in
Figure 1–4) that are better suited to the narrower layout.
w 4. Increase the width of the browser window and confirm that the layout
changes to a 2×3 grid of images (as shown in the tablet device image in
Figure 1–4), which is a design more appropriate for the wider window.

Figure 1–4 illustrates an important principle: HTML does not describe the
document’s appearance, it only describes the document’s content and structure. The
same HTML document can be rendered differently on different devices or screen sizes.
The actual appearance of the document is determined by style sheets—a topic you’ll
explore later in this tutorial.

Creating an HTML File


Now that you’ve studied the structure of an HTML file, you’ll start creating your
own documents for the Curbside Thai website. Sajja wants you to create a web page
containing information about the restaurant. Start by inserting the doctype and the
markup tags for the html, head, and body elements. You will also specify English (en)
as the language of the web page by adding the lang attribute to the <html> tag.
HTML 14 HTML 5 and CSS | Tutorial 1 Getting Started with HTML 5

To begin writing the HTML file:


w 1. Using the editor of your choice, create a new blank HTML file in the html01 c
HTML filenames should tutorial folder, saving the file as ct_about.html.
be entered in lowercase
letters and have no blank
w 2. Enter the following code into the file:
spaces. <!DOCTYPE html>
<html lang="en">

<head>
</head>

<body>
</body>

</html>

Figure 1–5 shows the initial elements in the document.

Figure 1–5 Initial structure of the ct_about.html file

document type declaration


identifies the markup
language as html

opening <html> tag


marks the start of
the document and
specifies the
head element will
language
contain information
about the document
body element will
contain the content
displayed by the
closing </html> tag
browser
marks the end of
the document

w 3. Save your changes to the file.

Next, you’ll add elements to the document head.


Tutorial 1 Getting Started with HTML 5 | HTML 5 and CSS HTML 15

Written Communication: Writing Effective HTML Code

PROSKILLS
Part of writing good HTML code is being aware of the requirements of various
browsers and devices, as well as understanding the different versions of the language.
Here are a few guidelines for writing good HTML code:
• Become well versed in the history of HTML and the various versions of HTML and
XHTML. Unlike other languages, HTML’s history does impact how you write your
code.
• Know your market. Do you have to support older browsers, or have your clients
standardized on one particular browser or browser version? Will your web pages be
viewed on a single device such as a computer, or do you have to support a variety
of devices?
• Test your code on several different browsers and browser versions. Don’t assume
that if your page works in one browser, it will work in other browsers or even in
earlier versions of the same browser. Also check on the speed of the connection. A
large file that performs well with a high-speed connection might be unusable with a
slower connection.
• Read the documentation on the different versions of HTML and XHTML at the W3C
website and keep up to date with the latest developments in the language.
To effectively communicate with customers and users, you need to make sure your
website content is always readable. Writing good HTML code is a great place to start.

Creating the Document Head


The document head contains metadata, which is content that describes the document
or provides information about how the document should be processed by the browser.
Figure 1–6 describes the different metadata elements found in the document head.

Figure 1–6 HTML metadata elements

Element Description
head Contains a collection of metadata elements that describe the document or
provide instructions to the browser
base Specifies the document’s location for use with resolving relative hypertext
links
link Specifies an external resource that the document is connected to
meta Provides a generic list of metadata values such as search keywords, viewport
properties, and the file’s character encoding
script Provides programming code for programs to be run within the document
style Defines the display styles used to render the document content
title Stores the document’s title or name, usually displayed in the browser title bar
or on a browser tab

The first metadata you’ll add to the About Curbside Thai web page is the title element.
HTML 16 HTML 5 and CSS | Tutorial 1 Getting Started with HTML 5

Setting the Page Title


The title element is part of the document head because it’s not displayed within the
web page, but rather in the browser title bar or browser tab. Page titles are defined
using the following title element
<title>document title</title>

where document title is the text of the title. Add a page title to the Curbside Thai
page now.

Adding a Document Title


REFERENCE

• To define the document title, enter the following tag into the document head:
<title>document title</title>

where document title is the text that will appear on the browser title bar or a
browser tab.

To insert the document title:


w 1. Directly after the opening <head> tag, insert the following title element,
Document titles should be indented to make the code easier to read.
no more than 64 characters
in length to ensure that the
<title>About Curbside Thai</title>
text fits on the browser title
bar or a browser tab. Figure 1–7 highlights the code for the page title.

Figure 1–7 Entering the document title

title text that appears


in the browser title bar
or on a browser tab

w 2. Save your changes to the file.

Adding Metadata to the Document


Another metadata is the meta element, which is used for general lists of metadata
values. The meta element structure is
<meta attributes />

where attributes define the type of metadata that is to be added to a document.


Figure 1–8 lists the attributes of the meta element.
Tutorial 1 Getting Started with HTML 5 | HTML 5 and CSS HTML 17

Figure 1–8 Attributes of the meta element

Attribute Description
charset="encoding" Specifies the character encoding used in the
HTML document
content="text" Provides the value associated with the
http-equiv or name attributes
http-equiv="content-type|default- Provides an HTTP header for the document’s
style|refresh" content, default style, or refresh interval (in
seconds)
name="text" Sets the name associated with the metadata

For example, you can use the following meta element to provide a collection of
keywords for the Curbside Thai website that would aid web search engines, such as
Google or Bing search tools, to locate the page for potential customers:
<meta name="keywords" content="Thai, restaurant, Charlotte, food" />

The name attribute defines the type of metadata and the content attribute provides the
data values. HTML does not specify a set of values for the name attribute, but commonly
used names include keywords, description, author, and viewport.
Another use of the meta element is to define the character encoding used in the
The title element and the HTML file. Character encoding is the process by which the computer converts text
charset meta element are into a sequence of bytes when it stores the text and then converts those bytes back into
both required in a valid characters when the text is read. The most common character encoding is UTF-8, which
HTML 5 document. supports almost all of the characters you will need. To indicate that the document is
written using UTF-8, add the following meta element to the document head:
<meta charset="utf-8" />

The charset attribute was introduced in HTML 5 and replaces the following more
complicated expression used in earlier versions of HTML:
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />

Adding Metadata to the Document


REFERENCE

• To define the character encoding used in the document, enter


<meta charset="encoding" />

where encoding is the character encoding used in the document.


• To define search keywords associated with the document, enter
<meta name="keywords" content="terms" />

where terms is a comma-separated list of keyword terms.

Add meta elements to the document head now, providing the character set and a list
of keywords describing the page.
HTML 18 HTML 5 and CSS | Tutorial 1 Getting Started with HTML 5

To insert metadata:
w 1. Directly after the opening <head> tag, insert the following meta elements,
The <meta> tag that indented to make the code easier to read:
defines the character
<meta charset="utf-8" />
encoding should always be
the first meta element in <meta name="keywords"
the document head. content="Thai, restaurant, Charlotte, food" />

Figure 1–9 highlights the newly added meta elements used in the document
head.

Figure 1–9 Adding metadata to a document

character encoding keywords used for


used in the document search engines

w 2. Save your changes to the file.


w 3. Open the ct_about.html file in your browser. Confirm that the browser tab or
browser title bar contains the text “About Curbside Thai”. There should be
no text displayed in the browser window because you have not added any
content to the page body yet.

Before continuing with your edits to the ct_about.html file, you should document
your work. You can do this with HTML comments.

Adding Comments to Your Document


An HTML comment is descriptive text that is added to the HTML file but that does not
appear in the page. Comments can include the name of the document’s author, the
date the document was created, and the purpose for which the document was created.
Comments are added with the following markup:
<!-- comment -->

where comment is the text of the comment or note. For example, the following code
inserts a comment describing the Curbside Thai page:
<!-- General Information about Curbside Thai -->

A comment can be spread across several lines as long as the comment begins
Always include comments with <!-- and ends with -->. Because comments are ignored by the browser, they can
when working with a team be added anywhere within a document, though it’s good practice to always include
so that you can document a comment in the document head in order to describe the document content that
the development process follows.
for other team members.
Tutorial 1 Getting Started with HTML 5 | HTML 5 and CSS HTML 19

Adding a Comment to an HTML Document

REFERENCE
• To insert a comment anywhere within your HTML document, enter
<!-- comment -->

where comment is the text of the HTML comment.

Add comments to the ct_about.html file indicating the document’s author, date of
creation, and purpose.

To add a comment to the document:


w 1. Return to the ct_about.html file in your HTML editor.
HTML comments must w 2. Directly after the opening <head> tag, insert the following comment text,
be closed with the --> indented to make the code easier to read:
characters.
<!--
New Perspectives on HTML 5 and CSS, 8th Edition
Tutorial 1
Tutorial Case
General Information about Curbside Thai
Author: your name
Date: the date

Filename: ct_about.html
-->

where your name is your name and the date is the current date. Figure 1–10
highlights the newly added comment in the file.

Figure 1–10 Adding a comment to the document

Comment added
to the document

w 3. Save your changes to the file.


HTML 20 HTML 5 and CSS | Tutorial 1 Getting Started with HTML 5

Conditional Comments and Internet Explorer

INSIGHT
Another type of comment you will encounter in many HTML files is a conditional
comment, which encloses content that should only be run by particular versions of the
Internet Explorer browser. The general form of the conditional comment is
<!--[if operator IE version]>
content
<![endif]-->

where operator is a logical operator (such as less than or greater than), version is
the version number of an Internet Explorer browser, and content is the HTML code
that will be run only if the conditional expression is true. The following code uses the
lt (less than) logical operator to warn users that they need to upgrade their browser if
they are running Internet Explorer prior to version 8.
<!--[if lt IE 8]>
<p>Upgrade your browser to view this page.</p>
<![endif]-->

Other logical operators include lte (less than or equal to), gt (greater than), gte
(greater than or equal to), and ! (not). For example, the following code uses the logical
operator ! to display the paragraph text only when the browser is not Internet Explorer:
<!--[if !IE]>
<p>You are not running Internet Explorer.</p>
<![endif]-->

Note that if you omit the version number, the conditional comment is applied to all
Internet Explorer versions.
The need for conditional comments arose because Internet Explorer significantly
differed from other browsers in how it implemented HTML and there was a need to
separate the code meant for the IE browser from code meant for other browsers. This
is not as much of a problem with Microsoft ending development of Internet Explorer
in favor of the Edge browser, but you may still encounter legacy websites that use
conditional comments in their code.

In the next session, you’ll continue your work on the ct_about.html file by adding
content to the page body.
Tutorial 1 Getting Started with HTML 5 | HTML 5 and CSS HTML 21

Session 1.1 Quick Check

REVIEW
1. What is a markup language?
a. A language used for e-commerce websites
b. A language describing the content and structure of a document by tagging
document elements
c. A language introduced by Microsoft for use in web browsers
d. A language that defines the appearance of web pages for computers and
cell phones
2. WordPress is a:
a. web browser
b. text editor
c. web content management system
d. web framework
3. What does W3C stand for?
a. World Wide Web Computing
b. World Wide Web Corporation
c. World Wide Web Creators
d. World Wide Web Consortium
4. Which of the following is the proper form of an HTML 5 doctype?
a. <doctype html>
b. <DOCTYPE html>
c. <doctype>html</doctype>
d. <!DOCTYPE html>
5. Which of the following defines the page title for an HTML document?
a. <title>My Web Page</title>
b. <pageTitle>My Web Page</title>
c. <head id="title">My Web Page</title>
d. <titleStart>My Web Page</titleEnd>
6. Which of the following is not proper HTML syntax?
a. <p>Welcome to my <em>web page</em></p>
b. <em><p>Welcome to my web page</em></p>
c. <p><em>
Welcome to my
web page
</em></p>
d. <p>Welcome to my
<em>web page</em>
</p>
7. Which of the following defines “restaurant” as a search keyword for a web
page?
a. <keyword>restaurant</keyword>
b. <meta>restaurant</meta>
c. <meta name="keywords" content="restaurant" />
d. <meta keyword="restaurant" type="search" />
8. Which of the following uses the proper syntax for creating an HTML comment?
a. <! Home page for my personal website>
b. <comment>Home page for my personal website</comment>
c. // Home page for my personal website
d. <!-- Home page for my personal website -->
9. True or false: HTML describes how content should be rendered by the browser.
HTML 22 HTML 5 and CSS | Tutorial 1 Getting Started with HTML 5

Session 1.2 Visual Overview:


The <img> tag marks an
image using the file specified
in the src attribute.

The <h1> tag marks


a major heading. The <strong> tag marks
text of major importance
or seriousness.

The <p> tag marks


a paragraph.

The <em> tag marks


emphasized text.

A character entity
reference inserts a
character based on a
defined name.

The <cite> tag A numeric character


marks a citation. reference inserts a character
based on its code value.
© Kzenon/Shutterstock.com
Tutorial 1 Getting Started with HTML 5 | HTML 5 and CSS HTML 23

HTML Page Elements


The opening paragraph
of the article is marked Images are added
with the <p> tag. to the web page.

The main heading of


the article is marked
The restaurant name is marked with the <h1> tag.
with the <strong> tag to
indicate its importance.

Kzenon/Shutterstock.com
Nonbreaking space is
inserted with the &nbsp;
character entity reference.

A citation to a magazine is
marked with the <cite> tag.

An example of emphasized text Bullet characters are inserted


is marked with the <em> tag. with the &#8226; numeric
character reference.
HTML 24 HTML 5 and CSS | Tutorial 1 Getting Started with HTML 5

Writing the Page Body


Now that you have created the document head of the About Curbside Thai web page,
you’ll begin writing the document body, starting with general markup tags identifying
the major sections of the page body, and working inward to more specific content
within those sections.

Using Sectioning Elements


The first task in designing the page body is identifying the page’s major topics. A page
typically has a header, one or more articles that are the chief focus of the page, and a
footer that provides contact information for the author or company. HTML marks these
major topical areas using the sectioning elements described in Figure 1–11.

Figure 1–11 HTML sectioning elements

Element Description
address Marks contact information for an individual or group
article Marks a self-contained composition in the document such as a newspaper story
aside Marks content that is related to a main article
body Contains the entire content of the document
footer Contains closing content that concludes an article or section
h1, h2, h3, Marks major to minor headings with h1 representing the heading with the highest
h4, h5, h6 rank, h2 representing next highest-ranked heading, and so forth
header Contains opening content that introduces an article or section
nav Marks a list of hypertext or navigation links
section Marks content that shares a common theme or purpose on the page

For example, a news blog page might contain several major topics. To identify these
areas, the HTML code for the blog might include the following elements marking off
the page’s header, navigation list, article, aside, and footer.
<body>
<header>
</header>
<nav>
</nav>
<article>
</article>
<aside>
</aside>
<footer>
</footer>
</body>

These sectioning elements are also referred to as semantic elements because the tag
Sectioning elements can
name describes the purpose of the element and the type of content it contains. Even
be nested within each without knowing much about HTML, the page structure defined in the above code is
other; an article might easily understood from the tag names.
contain its own header,
footer, and collection of
navigation links.
Tutorial 1 Getting Started with HTML 5 | HTML 5 and CSS HTML 25

Defining Page Sections

REFERENCE
• To mark the page header, use the header element.
• To mark self-contained content, use the article element.
• To mark a navigation list of hypertext links, use the nav element.
• To mark a sidebar, use the aside element.
• To mark the page footer, use the footer element.
• To group general content, use the section element.

The About Curbside Thai page will have a simple structure containing a header, a
single article, and a footer. Within the header, there will be an h1 element providing a
main topic heading (not to be confused with the document title, which is displayed on
the browser title bar or a browser tab). Add this structure to the document body.

To define the sections in the page body:


w 1. If you took a break after the previous session, return to the ct_about.html file
in your HTML editor.
w 2. Directly after the opening <body> tag, insert the following HTML code,
indented to make the code easier to read:
<header>
<h1>Curbside Thai</h1>
</header>
<article>
<h1>About Us</h1>
</article>
<footer>
Curbside Thai 411 Belde Drive, Charlotte NC 28201 704-555-1151
</footer>

Figure 1–12 highlights the sectioning elements used in the page body.

Figure 1–12 Adding sectioning elements to the page body

document header page heading

main article in the article heading


document

document footer

w 3. Save your changes to the file.


HTML 26 HTML 5 and CSS | Tutorial 1 Getting Started with HTML 5

Comparing Sections in HTML 4 and HTML 5


Many of the sectioning elements described in Figure 1–11 were introduced in HTML 5.
Prior to HTML 5, sections were defined as divisions created using the following div
element:
<div id="id">
content
</div>

where id uniquely identifies the division. Figure 1–13 shows how the same page layout
marked up using sectioning elements in HTML 5 would have been defined in HTML
4.01 using div elements.

Figure 1–13 Sections in HTML 5.0 vs. divisions in HTML 4.01

HTML 5.0
<header></header>

<nav></nav> <section></section> <aside></aside>

<article></article>

<footer></footer>

HTML 4.01
<div id="header"></div>

<div id="nav"> <div id="section"></div> <div id="aside">


</div> </div>

<div id="article">
</div>

<div id="footer"></div>

One problem with div elements is that there are no rules for ids. One web designer
might identify the page heading with the id header, while another designer might use
heading or top. The lack of consistency makes it harder for search engines to identify
the page’s main topics. The advantage of the HTML 5 sectioning elements is that their
tag name indicates their purpose in the document, leading to greater uniformity in how
pages are designed and interpreted. However, you might still encounter use of the div
element in older websites and within the code generated by web frameworks.

Using Grouping Elements


Within sectioning elements are grouping elements. Each grouping element organizes
similar content into a distinct group, much like a paragraph groups sentences that share
a common theme. Figure 1–14 describes the HTML grouping elements.
Tutorial 1 Getting Started with HTML 5 | HTML 5 and CSS HTML 27

Figure 1–14 HTML grouping elements

Element Description
blockquote Contains content that is quoted from another source, often with a citation and
often indented on the page
div Contains a generic grouping of elements within the document
dl Marks a description list containing one or more dt elements with each followed by
one or more dd elements
dt Contains a single term from a description list
dd Contains the description or definition associated with a term from a description list
figure Contains an illustration, photo, diagram, or similar object that is cross-referenced
elsewhere in the document
figcaption Contains the caption associated with a figure
hr Marks a thematic break such as a scene change or a transition to a new topic
(often displayed as a horizontal rule)
main Marks the main content of the document or application; only one main element
should be used in the document
ol Contains an ordered list of items
ul Contains an unordered list of items
li Contains a single item from an ordered or unordered list
p Contains the text of a paragraph
pre Contains a block of preformatted text in which line breaks and extra spaces in the
code are retained (often displayed in a monospace font)

The following code shows three paragraphs nested within a page article with each
paragraph representing a group of similar content:
<article>
<p>Content of 1st paragraph.</p>
<p>Content of 2nd paragraph.</p>
<p>Content of 3rd paragraph.</p>
</article>

The default style for browsers is to start sectioning or grouping elements on a new
line, separating them from any content that appears before it. Thus, each of these
paragraphs will appear in the web page on a new line as will the article itself. Note that
the exact appearance of the paragraphs and the space between them depends on the
styles applied by the browser to those elements. You’ll learn more about styles later in
this tutorial.

Defining Page Groups


REFERENCE

• To mark a paragraph, use the p element.


• To mark an extended quote, use the blockquote element.
• To mark the main content of a page or section, use the main element.
• To mark a figure box, use the figure element.
• To mark a generic division of page content, use the div element.
Another random document with
no related content on Scribd:
"I was born in the East Indies, though at what place I do not now
remember, and the very first thing I recollect is a dead tiger."

The scholar started as he heard these words, and turned his chair so
as to bring him a great deal nearer to Agatha. He looked at her
earnestly as she proceeded, and seemed deeply interested.

"I do not know how the tiger came to be dead, or how he came there
at all," continued Agatha; "but he lay upon the ground in front of my
father's house, and my mamma was persuading me to go near and
look at him, telling me that he was quite dead and would never kill
anybody again. I was dreadfully afraid at first, especially when my
brother, who was a great deal older than I, got astride of the tiger's
back and sat down; but after a while I let him take me on his knee.
He made me look at the tiger's teeth and claws, and stroke the fur on
his head, which was very soft and glossy; and I asked him to get me
a little tiger to play with. By-and-by they took him away, and his skin
was afterwards spread out on our floor."

"I remember having a Persian kitten with a bushy tail, and a beautiful
black bird which could talk and whistle, and would swear dreadfully
sometimes in spite of everything we could do to him; and I remember
a great lizard which lived on a tree planted in a tub and covered with
net-work. There were a good many colored servants about the
house, but lighter and having straight hair, who dressed very neatly
in white muslin. One of these belonged to me particularly. I used to
call him my bearer. He was very good to me. He used to carry me
about and do all sorts of things to amuse me, and I loved him dearly.
But it is very curious that, try as I will, I never can remember his
name, though I am sure I should know it in a minute, if I heard it
spoken."

"Was it Cashirim?" asked the scholar.

"That was it! That was it!" exclaimed Agatha. "How did you know it?"

"Never mind now. Go on with your story."


All the rest of the party looked at the scholar in surprise, for he was
very pale, and his eyes were fixed upon Agatha as if he would look
her through. He took no notice of them, however, and again begged
Agatha to go on with her story.

"I do not remember my father so very distinctly," continued Agatha,


"and I think he must have been away from home a great deal; but I
seem to see my mamma's face whenever I try to think of her. I never
saw any one who looked the least like her. She had rather delicate
health, and did not go out a great deal when my father was away.
She used to teach me my lessons every morning. I was very happy
in those days, and the first trouble I remember came from my
brother's going away. He was quite a grown-up young man then, and
he was always very kind to me, telling me stories and letting me ride
out with him, for I could ride on my pony when I was a very little girl."

"A gentleman came to our house about that time, whom I was told
was my mamma's brother, who had come all the way from America
to see her. He was very lively and pleasant, and I liked him very
much till he went away, and took Charley with him. Mamma told me
that Charley had gone to America to be educated, and would come
back to us after a while, but I never saw him again."

"Not a great while after my brother went away—I do not know exactly
how long—came a very sad time. My father was an officer, and I
used dearly to love to see him on horseback and dressed in his
uniform. His men were Indians—irregular horse, I know they were
called—and splendid, fine-looking men some of them were; but they
were all very good to me, and much pleased when I chattered to
them in their own language, of which I know a good deal."

"One day my father came home looking very much excited, and
called my mother aside. What he said to her I don't know, but she
gave a little scream and threw her arms round his neck. He kissed
her, and I heard him say: 'Try to be calm, dear Julia, for my sake.'"

"After that she was very quiet, and went about giving orders, and
seeing papa's things packed, as if he were only going away for a
day's shooting. When he had kissed us and bade us good-by, and
we could not see him any longer from the veranda, mamma led me
into her room and took me on her lap, where she cried and sobbed
over me for a long time. Then she told me that papa was going to
battle, and that we must pray to God to send him safe home again;
and so we did, but he never came back any more. Two or three days
after he went away, my father's orderly came galloping up to the
house. He dismounted, and spoke two or three words to the servants
as he passed through the veranda, at which they all broke out into
loud lamentations. I knew what he said, for, as I told you, I had
learned a good deal of the language. He said, 'Your master is killed!'"

"Mamma was lying on the couch in the inner room, with the blinds all
drawn down, for it was very hot, and she was not well. I ran in to her,
crying: 'Oh, mamma, my papa is killed!'"

"'What do you mean, Agatha?' she asked, rising and looking very
pale. 'Have you been dreaming? Who has heard anything of Papa?'"

"At that moment Jones came to the door, and as soon as mamma
saw him she guessed what had happened."

"'Is my husband dead, Jones?' she asked, as quietly as though it had


been an ordinary question."

"'I am sorry to say it is too true, ma'am,' he replied; and then he gave
her some letters to read, and turned away, brushing the tears from
his eyes, for all my papa's men loved him. My mamma read the
letters quite calmly, and then calling Jones' wife, who waited on her,
and giving me into her charge, she went away into her own room,
and shut the door. By that time the news was known all through the
cantonment, and several of the ladies came to see my mother, but
they could not do her any good. She just sat still in her chair, and did
not speak or seem to hear one word that was said to her."

"'This will never do,' said the doctor, who had come with the rest.
'She must be made to weep, or she will die.'"
"'Go to your mamma and talk to her about papa, my dear Agatha,'
said the chaplain's wife to me. I did as I was told, though I felt rather
afraid. At first she did not seem to notice me, but by-and-by she
burst into tears and cried bitterly for a long time. All the ladies
seemed glad, and I thought this very strange. It seemed cruel to me
that they should want my mamma to cry, but the chaplain's wife
explained to me that they thought she would feel better after it. She
was better, especially after the chaplain himself came and read to
her and prayed with her. He was a kind, good man, and that night,
he took me on his knee and talked to me a long time about dear
papa. He told me what a brave soldier and what a good man he had
been, and that he had no doubt of his being in heaven, where I
should some time see him if I loved my Saviour as he had done. All
this comforted me very much, and I have always remembered it."

"After this there was a great confusion, packing up, and selling off all
our things. I was told we were going to England to see my father's
relations, about whom I had never heard a great deal, for, when
mamma talked about my uncle, she always meant my uncle in
America, who had taken Charley."

"'Cannot we go to America, where Charley is?' I asked."

"'I hope we shall do so by-and-by,' she replied; 'but we must go to


England first.'"

"We went a long, long journey in palanquins and on horseback, and


down the river to Calcutta, where a great many people were very
kind to us, for papa had distinguished himself very much in the battle
where he was killed. Before long we set sail for England, leaving
behind us all the servants except Jones, who was going home to see
her relations. Oh, how I cried at parting with my poor bearer! I do not
remember much about the voyage, except that it seemed very long. I
thought only of mamma, who was very ill all the time, and grew
worse and worse, till just a week before we reached England she
died, and was buried in the sea. How dreadful it was to see my dear,
dear mamma's body thrown into the deep water! It seemed so much
worse than seeing her buried in the ground. I knew that she was in
heaven just the same, but still it has always been a grief to me that I
could never know exactly where my father and mother lay, for papa
was buried on the battle-field, and mamma lies in the ocean. They
were all very kind to me on the ship, but I was very sad, and cried all
the time; and Jones thought I would die too."

"Well, we arrived in London at last, and Jones took me to my uncle's


house, which was a very fine one in a grand square."

"The drawing-room in which my aunt sat was the handsomest I had


ever seen, but somehow it never looked pleasant to me. My aunt
received me very kindly, kissing me a great many times, and telling
me that she hoped I would be happy with her, but I could not help
thinking that she did not look very happy herself. I grieved sadly at
parting from Jones, but I was a little comforted by her promising to
come and see me as often as she could. When she was gone, my
aunt took me on her lap, called me her dear little girl, and asked me
a great many questions about papa and mamma, and my brother
Charles. It made me cry to talk of them, and before I had got over my
tears my uncle came home. He was a big man with a red face and
grizzled features, and I noticed that my aunt seemed frightened
when she heard his step, and hastily wiped her eyes."

"'Hallo. What does all this mean?' he asked, as he entered the room
and saw me sitting there."

"'This is my brother's little girl, from India, my dear,' she answered, in


a timid, submissive tone."

"'Umph! And what is she crying for? We want no cry babies here,
little miss. Quite enough of that sort of thing already.'"

"This was all the welcome he gave me. I felt as though I should
choke, and heartily wished myself back in the ship. By-and-by we
were called to dinner, which was splendidly set out in a beautiful
dining room, hung with pictures. My uncle did not speak a word all
through dinner, except to give an order or find fault about something;
and my aunt hardly spoke except to ask what I would have. Even
then my uncle contradicted her, and said I was to take what was
given me and not to choose for myself. It was plain even to me that
he was in very bad humor about something. Presently my uncle said
it was time for me to go to bed. So we left him drinking his wine all
alone, and my aunt took me up to my room, where I was to sleep."

"It was small, but very pleasant, and there was a picture of a pretty
little boy over the mantel-piece, which she told me was a portrait of
my father, painted when he was young. Aunt undressed me herself,
and heard me say my prayers, and after I was in bed, she sat down
and talked to me in a very affectionate manner for some time. She
told me she had no children of her own, and she would try to be a
mother to me. She told me also that I must be very good, and try to
please my uncle, who was very particular; and I promised to do my
best."

"Try as I might, I never could succeed. He never had a kind word for
me, end it seemed as if he were angry at my being in the house at
all. My aunt petted me a great deal when he was away, but if she did
so before him, he scolded her, and told her that she made a fool of
me—that I should have to work for my bread when I grew up, and
she was not to make me into a useless fine lady, like herself. Fool
was his favorite word, and he applied it to my aunt oftener than to
any one else. What made his conduct seem worse, was that before
company, he treated us both with the greatest kindness and
politeness; so that many people thought him the best of men. Indeed
I heard a lady say as she went away from one of our dinner parties—
my uncle often gave dinner parties—'What a pity it is that Mr. Morley
has such a dull, cross-looking wife! He seems such an admirable
man!'"

"I knew my aunt loved me, or I really believe I should have died of a
broken heart. But she could show her love to me only when we were
alone together. I had never seen Jones but once since she left me,
when she had come to tell me of the loss of her husband, who died
within a week of her leaving him. We were crying together over this
sad news—for I loved all my dear father's men, and Jones had been
a special favorite—when my uncle happened to come in, and seeing
me in tears, he ordered the servants never to admit that woman
again, declaring that she made me a worse baby than I was without
her. I tried to tell him what we were crying about, but it was of no use
—he never would listen to any explanation. My aunt taught me my
lessons, and I took great pains to please her, but I could hardly help
hating my uncle, and I dreaded to see him come into the house."

"One day, however, he actually came home in a good humor, and eat
his dinner without finding fault with anything. He spoke to me quite
kindly several times, helped me plentifully to sweetmeats, and after
he came into the drawing-room, he called me to him and made me
sit on his knee, a thing which he had never done before since I came
into the house. My aunt looked surprised and almost frightened, but
presently she ventured to say:"

"'Agatha has been a very good girl to-day.'"

"'Has she?' said my uncle, 'I am glad to hear it;' and he actually put
his hand in his pocket and pulled out a guinea."

"'Keep that and show it to your Yankee relations,' said he."

"'What do you menu, Mr. Morley?' said my aunt, turning pale."

"'I mean that I am going to send the child to her father's relations in
America,' he replied. 'That woman Jones, of whom she is so fond, is
going out to her daughter in New York, and she will take charge of
her. So you have nothing to do but to get her ready as fast as you
can. Let her have good clothes and plenty of them. I don't want the
Yankees to think that she has been neglected: and mind, madam, I
will have no whimpering about the matter. You can see plainly that
the child is glad enough to go.'"

"I believe I was pleased at the prospect of going to America, for I


thought I should see my kind uncle Hamblin and Charley again. But I
began to moderate my joy when I saw how unhappy my aunt was at
the thought of parting with me. She kissed me and cried over me that
night, calling me her only comfort; but when I said I would stay with
her if she wished it, she told me that there was no use in talking
about it—my uncle had made up his mind and would have his own
way. Jones came to see us the next day, and had a long private
conversation with my aunt, and so the matter was settled. All my old
clothes were laid aside, and I had a complete outfit of new ones; and
my aunt gave me five guineas in a little purse and bade me take
good care of it. My uncle paid my passage and gave Jones money
for my travelling expenses, after I should get to America; and my
aunt made her promise not to leave me till I was in my uncle's
hands."

"It seemed as though I was always to be unfortunate in my sea-


voyages, for before we were half-way across, the cholera broke out
in the ship. We were in the steerage. My uncle had told my aunt that
he had paid for a cabin passage for Jones and me, but it was not
true. The surgeon as well as the captain and other officers did all in
their power for the poor passengers, but many of them died, and
among the number my poor dear nurse."

"There was a poor widow, named Mrs. Mix, who had been very kind
to us all the way over, and Jones gave me into her charge, together
with the money my uncle had given her, begging her to put me in the
way of getting to my friends, which she promised to do. But it
seemed as though I were to have nothing but trouble in my travels.
In the bustle and confusion of our arrival in New York, my trunk was
lost or stolen, and I never saw it again. This was all the worse,
because all my money and my uncle's direction were in it. Mrs. Mix
had the direction from my nurse, but she had forgotten it, and I did
not know it at all. Mrs. Mix had expected her friends to meet her in
Now York, but they did not come, and after a few days, she received
a letter from them, telling her how to find them. They lived in
Greenbriar, and thither she went, taking me with her."

"The surgeon offered to get me into an asylum in New York, but this
she would not hear of: so I went with her into her little house, and
used to help her carry home the washing which she took from the
school. We thus became acquainted with Dr. and Mrs. Bower and
told them my story; and Mrs. Bower adopted me for her own
daughter. I have lived with them for three years, and been very
happy all the time. That is the end of my story."

The scholar had been listening silently, never taking his eyes from
Agatha's face for the whole time, As she closed her narrative, he
took from his breast a miniature case, opened it, and handed it to
Agatha without a word.

"My papa and mamma! My own dear papa, and mamma!" almost
screamed Agatha. "Oh, where did you get them? Did you know my
mamma? Do you know my brother?"

"Agatha!" said the scholar. "Do you remember that not very long
before Charles went away, he was thrown from his horse and got a
scar on his forehead?"

"Yes!" answered Agatha, breathlessly. "Why?"

The scholar pushed back his thick hair, and showed her a scar upon
the right side of his forehead, asking, "Do you remember me now?"

"Charley! Oh, Charley!"

In another moment, Agatha was in her brother's arms. I will not


undertake to describe the scene which followed. Presently the
scholar rose, and taking Agatha by the hand, led her into the room
and closed the door behind them.

"How strange!" said the old lady. "It seems as though there was a
Providence in it; your coming out of the way as you did, and even in
your being snowed up, since if it had not been for your stopping here
and our telling stories, they might not have found each other out after
all."
"There is a Providence in all things," observed the doctor, taking off
his spectacles and wiping them; "'All things work together for good to
them that love God,' though we do not always see the working so
plainly as in this particular instance."

"Agatha noticed her brother when we first came on the cars,"


remarked Herbert. "She said she was sure she remembered him,
though she could not tell where she had seen him: and I observed
that he took a great deal of notice of her. He kept looking at her all
the time he kept talking to me. I hope he won't want to take her away
from us! I don't know what my father would do without her, especially
now, that—" Herbert stopped abruptly and turned away his head.

"I would not worry about that, my dear," said the old lady, kindly. "I
dare say the matter will be managed, somehow. I guessed
something when he asked her if that was not the servant's name."

"And so Agatha has really found her brother, that she talks so much
about," said Frank. "What a fine-looking man he is! I wonder if he is
rich?"

"I hope not, and then he won't want to take Agatha away," said
Edward.

"O Ned, that would be selfish!" replied Herbert. "Her brother has the
best right to her, of course; though—but we won't borrow trouble
about that. How glad I am, Frank, that we came this way. Only for
your mistake, Agatha might not have found her brother at all."

"No thanks to me, though!" said Frank, laughing.

The conversation was now interrupted by the return of the scholar


and Agatha. They had both shed some tears, but they looked as
though they were perfectly happy in each other. The scholar sat
down, still keeping his arm round Agatha, as though afraid of losing
her again.
"You will be glad, no doubt, to hear a little farther explanation of my
sister's story," said he, after they had received the congratulations of
the party.

"I should!" said Edward. "I want to hear who your father was, and
how you came to leave him, and all about it."

The scholar smiled. "My father was an English officer," said he.
"When he was very young man, and in Canada, with his regiment,
he married a young lady, the daughter of an American sea captain. I
have understood that his family were very much displeased with the
match, and, his father dying soon after, left the whole of his property
to his step-daughter, a lady much older than my father, who had
married a London merchant. My father was very fond of this sister,
but her husband, as well as my grandfather, professed great
displeasure at the match my father had made, and would not allow
my aunt to see her brother, though they were permitted occasionally
to correspond."

"Captain Goldwin accompanied his regiment to India when I was


fourteen years old, and there Agatha was born. My father had no
income but his pay, and his expenses being necessarily great, he
found himself unable to send me to England for education, so I grew
up without any except what he was able to give me in the intervals of
military duty, and what I got from the resident chaplain. Still I had a
great fondness for study, and employed my time to pretty good
purpose."

"I was eighteen years old when my uncle came to India, partly on
business and partly to visit his sister. He proposed to my father that I
should return with him to America, finish my studies at one of the
colleges in New England, and then, if it were thought desirable,
return to India. The offer was a very advantageous one to me, and
my father allowed me to accept it. Before I left, my mother gave me
the miniatures I have just showed Agatha, and I have never parted
from them."
"In the course of two or three years, I heard of the death of my
father, who fell in battle, as Agatha told us, and learned that my
mother had set out for England, intending to come to her friends in
America. Hearing nothing more for a long time, I wrote to my aunt in
London. Her husband answered the letter, saying that my mother
died before reaching England; that he had sent the child—meaning
Agatha—to her friends in America, under such and such an escort,
and supposed she had reached her destination."

"I went at once to New York and made every inquiry, but my efforts
resulted only in disappointment. At last I learned that the cholera had
broken out in the ship and that a great many of the passengers had
died,—among them a woman named Jones and her little girl. This
account seemed to render the matter hopeless, and I gave up all
further inquiries. Agatha's face interested me at once from her
resemblance to my mother, but supposing, as I did, that my sister
was dead long ago, I should not have pursued the matter had not
her story awakened my long dead hopes."

"The mention of the dead tiger struck me like an electric shock, for I
remembered the incident directly and how hard I had begged to be
allowed to go with the party that killed him. He was a famous man-
eater, as they are called—that is to say a tiger which, having
acquired an appetite for human flesh, will eat no other. Such animals
are frequently found in the neighborhood of East Indian villages, a
great terror and pest to the inhabitants, and, in this case, the officers
stationed near had made a hunting party to kill him. As Agatha went
on, I felt certain that she must be my lost sister, and her instant
recognition of the miniatures would have confirmed me, had I by that
time entertained any doubt. My great desire is now to see Dr. Bower
and thank him for his kind care of my little darling."

"It grows late," remarked the squire, after a little pause, and looking
at his watch. "We have had a very pleasant evening and it has come
to a most happy conclusion. We will now have prayers, if the good
doctor will be so kind as to read them."
CHAPTER VII.
CONCLUSION.

EARLY the next morning the whole household was astir at Cedar
Hill. The children were up and dressed before daylight, wishing
everybody "Merry Christmas," and running all over the house, except
into the dining room, where the old lady allowed no one to set foot
but herself. By-and-by they had prayers in the parlor and the children
sung two or three Christmas carols, accompanied by Miss Hope on
the piano.

Then the dining room door was opened and they marched in
procession to the table. It was set out in great state, and there,
before every one's place, was a mysterious pile, carefully covered by
a white napkin. Grace was said, and then the piles were all
uncovered.
What wonders were disclosed! Books and toys for the children, all
sorts of pretty and useful things for everybody. Not one of the
strangers was forgotten, but each received a nice present, all the
nicer from being wholly unexpected. Abundance of presents had
been provided for the grandchildren of the family, besides those
which the doctor had in his trunk for his own little flock; and Harry,
May and Annie were only too glad to divide with their new friends.

A man had been sent over to the railroad station early in the
morning. He returned with the news that no train could possibly get
through before next morning. So it was decided that the big lumber
sleigh should be got out once more to take the whole party to church
in the village, about a mile off. Before church time, there were
several private conversations held in the house. Agatha, with Herbert
and her brother, sat in a corner of the parlor talking of their family
affairs. Miss Hope was closeted with the old lady in her room, and
Frank, with some embarrassment, requested to speak with the
doctor in the library.

"I wanted to ask you, sir," said he, looking down, "if you thought it
would be wrong for me to go to the communion this morning? I am to
be confirmed at Easter, at any rate, and—I am so thankful for the
way everything has turned out—and—I know I am not good enough,
doctor, but I want to be a better boy, and I do love Him!"

"You know, Frank, what is said in the Prayer-book," said the doctor,
kindly. "I say nothing of the Rubric, because you have just told me
that you are 'ready and desirous to be confirmed;' but here is the
invitation. Examine yourself by it. Do you truly and earnestly repent
you of your sins?"

"Yes sir, I hope so."

"And are you in love and charity with your neighbors?"

"I believe so," said Frank. "I hav'n't any enemies that I know of, so I
hav'n't anything to forgive, and I should be very wicked indeed if I did
not feel kindly towards every one this morning, after God has been
so good to me."

"And do you intend to lead a new life, following the commandments


of God, and walking from henceforth in His holy ways? Think well
before you speak."

"I have been trying to do so this long time, doctor," said Frank. "I get
discouraged a great many times, but I have not left off trying."

The doctor asked Frank a good many more questions, tending to


test his knowledge of Christian doctrine and of his own heart. Frank
had been carefully instructed, especially since his residence with
Doctor Bower, and the doctor, who was accustomed to dealing with
young people, was quite satisfied with his answers.

"Well, my son," said he, at last, "from all that you tell me I can see no
reason why you should not draw near with faith and take your part in
the feast of love. In the sense of sin-lessness no one is worthy, but
any one who repents and believes, placing all his hopes of salvation
upon the great atoning sacrifice of Christ our Lord, may safely take
this holy sacrament, to his comfort. But how is it with your
companions?"

"Oh, Herbert has been a communicant these two years, and Agatha
since last Easter. She was so little and looked so young that the
bishop was in doubt about her; but he examined her himself and was
quite satisfied."

"I am glad to hear it," said the doctor. "I advise you, Frank, to spend
the hour between this and church time in prayer and rending."

The doctor marked certain chapters for him, and Frank remained
alone in the library till all were called to go to church.

"Isn't it nice?" said Annie to Agatha, as they sat together in the


sleigh, coming home. "Grandmamma has been talking with Miss
Hope, and she is to stay and be my governess! You see, it is too far
for me to go to school in the village, especially in winter, and there is
no one to teach me music or French. But grandmamma has found
out that she used to know Miss Hope's mother at school, and—oh, I
can't tell you all about it, only Miss Hope has no home now, and no
money, and she was going to try for a place in a public school. But
now she is going to live with us. That will be a great deal nicer for
her, won't it?"

"Yes, indeed!" said Agatha, hastily; "and nicer for you, too. Miss
Hope seems such a pleasant young lady. I liked her the very first
minute I saw her."

"And she will be company for grandmamma too, you know,"


continued Annie. "Oh, how glad I am you got snowed up and came
to our house!"

"And so am I," replied Agatha, smiling.

In the evening the sleigh was again put in requisition, and all the
young party went down to the village to attend the Sunday-school
festival. Agatha's story had already become known, and she
received a great deal of attention, almost enough to turn the head of
a little girl of thirteen: but her brother, who watched her closely, was
delighted to see that she preserved through all the quiet and lady-
like demeanor which had so pleased him from the first.

Herbert could not but feel sad at even the distant and uncertain
prospect of losing the sister he had learned to love so much; but he,
tried hard not to be selfish, and to rejoice in her joy. As for Frank and
Ned, they were ready to be pleased with everything. Ned found a
congenial playmate in the clergyman's son, a frank, manly boy of his
own age, who was expecting to go to Doctor Bower's school after
the Christmas holidays. Frank was graver than usual, but his face
wore a look of subdued happiness very pleasant to see.

The next morning early came a message from the station-master


that the train had been telegraphed and would be through in less
than an hour. All was bustle directly. The old lady filled a famous
basket with cakes, cold chicken and other good things, lest the
children should be hungry on the road. All the children from Cedar
Hill accompanied the guests to the station, and bidding good-by to
their kind entertainers, the children and the doctor were soon in the
cars and on their way to their homes.

At J—, Agatha expected to separate from her brother for a little


while. Mr. Goldwin intended to follow Doctor Bower to New York, and
Herbert gave him a letter of introduction to his father, with some
account of their meeting. It was hard for Agatha to separate from her
brother even for a few days, but she tried to submit cheerfully,
exacting from him a promise to write to her directly, and somewhat
comforted by the miniatures of her father and mother which were left
in her care.

To the joyful surprise of Frank and Edward, the very first person they
met on stopping from the train at J— was their father. The non-arrival
of the children, together with the appearance of their trunks, caused
great surprise at home, and Judge Landon telegraphed at once to
Greenbrier to find out the cause of their delay. Ascertaining, after
considerable trouble, that they had taken the wrong train and were
probably snowed up somewhere on the road, he came over to J— in
hope of further intelligence, and arrived half an hour before the train
came in. Of course the whole story of the mistake had to be gone
over, and I am happy to say that Frank bore the laughter of his
friends with perfect good humor. Indeed, as it turned out, he could
afford to do so, though, as he justly observed, there were no thanks
due to him.

Herbert and Agatha passed their Christmas holidays very pleasantly


at Judge Landon's, and towards the end of them they were
agreeably surprised by the appearance of Doctor Bower and Mr.
Goldwin.

Agatha was perfectly happy at seeing her father and brother


together. She had made up her mind, as she said, "they would suit
each other exactly," nor was she disappointed in her expectation.
Her mind had nevertheless been a good deal disturbed by the
thought that she must be separated from one or the other of them.
She felt that she could not live apart from her brother, and yet she
did not know how to leave the kind doctor, who had been a father to
her when she was left alone in a strange land. This consideration
had caused her a good deal of anxiety, which was destined soon to
be set at rest.

"Good news, Agatha!" cried Herbert, one morning, after the doctor
and Mr. Goldwin had been closeted together for some hours. "It is all
settled! Father has just told me all about it. You are not to go away
from us, and yet you are to live with your brother, too. Isn't that
splendid?"

"But how, Herbert?" asked Agatha. "I don't understand."

"Why, you know my father has been wanting a partner."

"I did not know it. But never mind. What then?"

"He says the entire charge of the school is rather too much for him,"
continued Herbert. "He is not so young as he has been, and he
wants time to study and to work at the big book he is writing. It was
partly that which took him to New York. He wished to see a
gentleman who was recommended to him. But when he came to see
the gentleman, he found that they could not agree at all, and he was
just considering what to do when your brother arrived. You know, I
told you that they had been at the same college, and when they
came to compare notes, they found that they knew a great many of
the same people. Father wrote to some of the professors about your
brother, and they all agreed in saying that he was exactly the man he
wanted for the place. So they have been talking the matter over
again this morning, and it is all settled."

"But, Herbert, I don't quite understand yet."

"Why, Mr. Goldwin goes into partnership with my father in the school,
and will take most of his classes off his hands. So, of course, he will
have to live with us."
"I see!" said Agatha. "How glad I am! You don't know how I have
been worrying about it all these holidays."

"Yes, I do," returned Herbert. "I have seen it all, and I felt just so, but
I could not help hoping it would all come right, somehow. I am so
glad! You know mamma wanted father to have a partner."

"Oh, I do wish she was here to see Charley!" said Agatha. "Would
she not be glad, if she knew?"

"Perhaps she does," replied Herbert, in a low voice. "At any rate she
will know, some day."

When our young friends returned home Mr. Goldwin accompanied


them. Doctor Bower found his labors greatly lightened by his new
assistant, who fell in with all his plans and methods for the
improvement of his pupils, and the boys were delighted with their
new master, who, though sufficiently dignified and strict in school,
was a famous ball player and gymnast, and was a perfect magazine
of stories and plays for rainy days.

Miss Hope remained at Cedar Hill as governess to little Annie and


companion to her grandmother, and enjoyed the double pleasure of
finding a happy home in her loneliness and making herself useful to
the dear old lady, who was much alone, now that all her daughters
were married.

The doctor is well, and is at present looking forward to the pleasure


of having all his young friends together at his own house for the next
Christmas.

Hoping that these same holidays may prove as pleasant to my


young readers as they are likely to do to the children of whom I have
been writing, I wish them a merry Christmas and a happy New-Year,
and bid them a kindly farewell.

You might also like