You are on page 1of 53

New Perspectives HTML5 and CSS3

Comprehensive 7th Edition Patrick M.


Carey
Visit to download the full and correct content document:
https://textbookfull.com/product/new-perspectives-html5-and-css3-comprehensive-7th
-edition-patrick-m-carey/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

New Perspectives on HTML5, CSS3, and JavaScript 6th


Edition Patric Carey

https://textbookfull.com/product/new-perspectives-on-
html5-css3-and-javascript-6th-edition-patric-carey/

New Perspectives on HTML 5 and CSS Comprehensive 8th


Edition Patrick M Carey

https://textbookfull.com/product/new-perspectives-on-html-5-and-
css-comprehensive-8th-edition-patrick-m-carey/

New Perspectives on HTML 5 and CSS 8th Edition Patrick


M. Carey

https://textbookfull.com/product/new-perspectives-on-html-5-and-
css-8th-edition-patrick-m-carey/

Murach s HTML5 and CSS3 Anne Boehm

https://textbookfull.com/product/murach-s-html5-and-css3-anne-
boehm/
Learn PHP 8: Using MySQL, JavaScript, CSS3, and HTML5
Second Edition Steve Prettyman

https://textbookfull.com/product/learn-php-8-using-mysql-
javascript-css3-and-html5-second-edition-steve-prettyman/

New Perspectives Microsoft Windows 10 Comprehensive


Lisa Ruffolo

https://textbookfull.com/product/new-perspectives-microsoft-
windows-10-comprehensive-lisa-ruffolo/

Beginning iPhone and iPad Web Apps Scripting with HTML5


CSS3 and JavaScript 1st Edition Apers Chris Paterson
Daniel

https://textbookfull.com/product/beginning-iphone-and-ipad-web-
apps-scripting-with-html5-css3-and-javascript-1st-edition-apers-
chris-paterson-daniel/

Responsive Web Design by Example Embrace responsive


design with HTML5 CSS3 JavaScript jQuery and Bootstrap
4 Hussain

https://textbookfull.com/product/responsive-web-design-by-
example-embrace-responsive-design-with-html5-css3-javascript-
jquery-and-bootstrap-4-hussain/

Using SVG with CSS3 and HTML5 Vector Graphics for Web
Design Early Release Raw Unedited 1st Edition Amelia
Bellamy-Royds

https://textbookfull.com/product/using-svg-with-css3-and-
html5-vector-graphics-for-web-design-early-release-raw-
unedited-1st-edition-amelia-bellamy-royds/
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Want to turn C’s
into A’s? Obviously, right?
But the right way to go about it isn’t always so obvious. Go digital to
get the grades. MindTap’s customizable study tools and eTextbook
give you everything you need all in one place.

Engage with your course content, enjoy the flexibility of


studying anytime and anywhere, stay connected to assignment due
dates and instructor notifications with the MindTap Mobile app...
and most of all…EARN BETTER GRADES.

TO GET STARTED VISIT


WWW.CENGAGE.COM/STUDENTS/MINDTAP
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
New PersPecti ves oN

HTML5 and CSS3


7th Edition

Comprehensive

Patrick Carey

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


New Perspectives on HTML5 and CSS3, 7th Edition, © 2017 Cengage Learning
Comprehensive
ALL RIGHTS RESERVED. No part of this work covered by the copyright
Patrick Carey
herein may be reproduced, transmitted, stored or used in any form or by
any means graphic, electronic, or mechanical, including but not limited to
Senior Product Director: Kathleen McMahon photocopying, recording, scanning, digitizing, taping, Web distribution,
Associate Product Manager: Kate Mason information networks, or information storage and retrieval systems, except
Associate Content Development Manager: Alyssa as permitted under Section 107 or 108 of the 1976 United States Copyright
Pratt Act, without the prior written permission of the publisher.

Development Editor: Pam Conrad


Product Assistant: Abby Pufpaff For product information and technology assistance, contact us at
Cengage Learning Customer & Sales Support, 1-800-354-9706
Senior Content Project Manager:
Jennifer K. Feltri-George
For permission to use material from this text or product, submit all
Art Director: Diana Graham requests online at www.cengage.com/permissions
Manufacturing Planner: Fola Orekoya Further permissions questions can be emailed to
permissionrequest@cengage.com
Cover image(s): Shutterstock/AGCuesta
Compositor: GEX Publishing Services Library of Congress Control Number: 2016954611
ISBN: 978-1-305-50393-9

Cengage Learning
20 Channel Center Street
Boston, MA 02210
USA

Cengage Learning is a leading provider of customized learning solutions


with office locations around the globe, including Singapore, the United
Kingdom, Australia, Mexico, Brazil, and Japan. Locate your local office at:
www.cengage.com/global

Cengage Learning products are represented in Canada by


Notice to the Reader Nelson Education, Ltd.

Publisher does not warrant or guarantee any of the For your course and learning solutions, visit www.cengage.com
products described herein or perform any
independent analysis in connection with any of the Purchase any of our products at your local college store or at our
product information contained herein. Publisher does preferred online store www.cengagebrain.com
not assume, and expressly disclaims, any obligation Some of the product names and company names used in this book have
to obtain and include information other than that been used for identification purposes only and may be trademarks or regis-
provided to it by the manufacturer. The reader is tered trademarks of their respective manufacturers and sellers.
expressly warned to consider and adopt all safety
precautions that might be indicated by the activities Disclaimer: Any fictional data related to persons or companies or URLs used
described herein and to avoid all potential hazards. throughout this book is intended for instructional purposes only. At the
By following the instructions contained herein, the time this book was printed, any such data was fictional and not belonging
reader willingly assumes all risks in connection with to any real persons or companies.
such instructions. The publisher makes no
Microsoft and the Windows logo are registered trademarks of Microsoft
representations or warranties of any kind, including
Corporation in the United States and/or other countries. Cengage Learning
but not limited to, the warranties of fitness for
is an independent entity from Microsoft Corporation, and not affiliated with
particular purpose or merchantability, nor are any
Microsoft in any manner.
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: 2016
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
HTML5 and CSS3 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 detailed
About This Book
instructions and real- This book provides thorough coverage of HTML5 and CSS3, and includes the following:
world application
• Up-to-date coverage of using HTML5 to create structured websites
examples. It is ideal for
classroom and online • Instruction on the most current CSS3 styles to create visually-interesting pages and
instruction. At the end captivating graphical designs
of the term my students • Working with browser developer tools to aid in the creation and maintenance of
comment on how much fully-functioning websites
they’ve learned and New for this edition!
put to use outside the
classroom.”
• Coverage of responsive design techniques to create website designs that can scale to
—Bernice Howard mobile, tablet, and desktop devices.
St. Johns River Community • Hands-on study of new HTML elements and CSS styles including layouts using
College flexboxes and grid frameworks.
• Exploration of CSS3 styles for graphic design, including image borders, drop shadows,
gradient fills, 2D and 3D transformations, and graphic filters.
• Exploration of responsive design for web tables.
• Coverage of CSS styles for animation and transitions.
• Coverage of JavaScript arrays, program loops, and conditional statements.

System Requirements
This book assumes that students have an Internet connection, a text editor, and a current
browser that supports HTML5 and CSS3. 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 15, Firefox 48.02, Safari 10, Opera 39.0, and Google Chrome 53. 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 HTML5 and CSS3 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 53
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 book Context
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-by-step
—John Taylor
work. Colorful screenshots help guide students through the steps. trouble? tips, which anticipate
Southeastern Technical
College
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.

rev iew Assessment


Retention is a key component to learning. At the end of each session, a series of Quick Check
aPPlY
questions helps students test their understanding of the material before moving on. Engaging
ch alleNge end-of-tutorial Review Assignments and Case Problems have always been a hallmark feature of
cre ate the New Perspectives Series. Colorful bars and brief descriptions accompany the exercises,
making it easy to understand both the goal and level of challenge 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.
HTML5 and CSS3, 7th 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 Learning 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 HTML5 and CSS3 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 editor, Pam Conrad, for her hard work, attention to detail, and
valuable insights, and to Associate Content Developer Manager, Alyssa Pratt, who has worked
tirelessly in overseeing this project and made my task so much easier with enthusiasm and
good humor. Other people at Cengage who deserve credit are Kathleen McMahon,
Sr. Product Manager; Kate Mason, Associate Project Manager; Abby Pufpaff, Product
Assistant; Jen Feltri-George, Senior Content Project Manager; Diana Graham, Art Director;
Fola Orekoya, Manufacturing Planner; GEX Publishing Services, Compositor, as well as
Chris Scriver - Sr. MQA Project Leader, and the MQA testers John Freitas and Danielle Shaw.
vi New Perspectives Series

Feedback is an important part of writing any book, and thanks go to the following reviewers
for their helpful ideas and comments: Alison Consol, Wake Technical Community College;
Dana Hooper, The University of Alabama; Kenneth Kleiner, Fayetteville Technical Community
College; and Laurie Crawford, Franklin University.

I want to thank my wife Joan and my six children for their love, encouragement, and patience
in putting up with a sometimes distracted husband and father. This book is dedicated to my
grandchildren: Benedict, David, and Elanor.
– Patrick Carey
HTML5 and CSS3, 7th Edition, Comprehensive vii

BRIEF ConTEnTS
htMl level i tutorials
tutorial 1 Getting Started with HTML5 . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 1
Creating a Website for a Food Vendor
tutorial 2 Getting Started with CSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 83
Designing a Website for a Fitness Club

level ii tutorials
tutorial 3 Designing a Page Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 169
Creating a Website for a Chocolatier
tutorial 4 Graphic Design with CSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 257
Creating a Graphic Design for a Genealogy Website
tutorial 5 Designing for the Mobile Web . . . . . . . . . . . . . . . . . . . . . . . . HTML 341
Creating a Mobile Website for a Daycare Center

level iii tutorials


tutorial 6 Working with Tables and Columns . . . . . . . . . . . . . . . . . . . . . HTML 433
Creating a Program Schedule for a Radio Station
tutorial 7 Designing a Web Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 499
Creating a Survey Form
tutorial 8 Enhancing a Website with Multimedia . . . . . . . . . . . . . . . . . . HTML 585
Working with Sound, Video, and Animation
tutorial 9 Getting Started with JavaScript . . . . . . . . . . . . . . . . . . . . . . . HTML 665
Creating a Countdown Clock
tutorial 10 Exploring Arrays, Loops, and Conditional Statements . . . . . HTML 735
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
HTML5 and CSS3, 7th Edition, Comprehensive ix

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 htMl5 Comparing Sections in HTML4 and HTML5 . . . . . 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 Characters. . . HTML 33
Locating Information on a Network. . . . . . . . . . . . HTML 4 Character Encoding . . . . . . . . . . . . . . . . . . . . . . . HTML 33
Web Pages and Web Servers . . . . . . . . . . . . . . . . . HTML 5 Character Entity References. . . . . . . . . . . . . . . . . HTML 34
Introducing HTML . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 5 Working with Inline Images . . . . . . . . . . . . . . . . . . . HTML 36
The History of HTML. . . . . . . . . . . . . . . . . . . . . . . . HTML 5 Line Breaks and Other Empty Elements . . . . . . . . HTML 38
Tools for Working with HTML . . . . . . . . . . . . . . . . . . . HTML 6 Working with Block Quotes and Other Elements . . . HTML 39
Testing your Code . . . . . . . . . . . . . . . . . . . . . . . . . HTML 7 Session 1.2 Quick Check . . . . . . . . . . . . . . . . . . . . . . HTML 45

Supporting the Mobile Web. . . . . . . . . . . . . . . . . . HTML 7 sessioN 1.3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 46


Exploring an HTML Document . . . . . . . . . . . . . . . . . . HTML 7 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 14 Specifying the Folder Path . . . . . . . . . . . . . . . . . . . . HTML 60

Creating the Document Head . . . . . . . . . . . . . . . . . . HTML 15 Absolute Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 61

Setting the Page Title . . . . . . . . . . . . . . . . . . . . . HTML 15 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 Marking Locations with the id Attribute . . . . . . HTML 63
Linking to an id . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 63
Anchors and the name Attribute . . . . . . . . . . . . . HTML 63
x New Perspectives Series

Linking to the Internet and Other Resources . . . . . . HTML 64 Employing Progressive Enhancement . . . . . . . . . . . HTML 104
Linking to a Web Resource . . . . . . . . . . . . . . . . . . HTML 65 Session 2.1 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 105
Linking to an E-Mail Address . . . . . . . . . . . . . . . . HTML 65
sessioN 2.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 106
Linking to a Phone Number . . . . . . . . . . . . . . . . . HTML 67
Exploring Selector Patterns . . . . . . . . . . . . . . . . . . HTML 108
Working with Hypertext Attributes. . . . . . . . . . . . . . HTML 68
Contextual Selectors . . . . . . . . . . . . . . . . . . . . . HTML 108
Session 1.3 Quick Check . . . . . . . . . . . . . . . . . . . . . . HTML 70
Attribute Selectors. . . . . . . . . . . . . . . . . . . . . . . .HTML 111
Review Assignments . . . . . . . . . . . . . . . . . . . . . . . . . HTML 71
Working with Fonts . . . . . . . . . . . . . . . . . . . . . . . . . HTML 115
Case Problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 74
Choosing a Font . . . . . . . . . . . . . . . . . . . . . . . . . HTML 115
tutorial 2 getting started with css
Designing a Website for a Fitness Club . . . . . . . . . . . . . htMl 83 Exploring Web Fonts . . . . . . . . . . . . . . . . . . . . . HTML 118

The @font-face Rule. . . . . . . . . . . . . . . . . . . . . . . HTML 118


sessioN 2.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 84
Setting the Font Size . . . . . . . . . . . . . . . . . . . . . . . . HTML 121
Introducing CSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 86
Absolute Units . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 121
Types of Style Sheets . . . . . . . . . . . . . . . . . . . . . . HTML 86
Relative Units . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 121
Viewing a Page Using Different Style Sheets. . . . HTML 87
Scaling Fonts with ems and rems. . . . . . . . . . . . HTML 122
Exploring Style Rules. . . . . . . . . . . . . . . . . . . . . . . . . HTML 90
Using Viewport Units . . . . . . . . . . . . . . . . . . . . . HTML 123
Browser Extensions. . . . . . . . . . . . . . . . . . . . . . . . HTML 90
Sizing Keywords . . . . . . . . . . . . . . . . . . . . . . . . . HTML 123
Embedded Style Sheets . . . . . . . . . . . . . . . . . . . . HTML 91
Controlling Spacing and Indentation . . . . . . . . . . . HTML 125
Inline Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 92
Working with Font Styles. . . . . . . . . . . . . . . . . . . . . HTML 127
Style Specificity and Precedence . . . . . . . . . . . . . HTML 92
Aligning Text Horizontally and Vertically . . . . . . HTML 128
Style Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . HTML 93
Combining All Text Formatting in a Single Style. . . HTML 128
Browser Developer Tools . . . . . . . . . . . . . . . . . . . HTML 93
Session 2.2 Quick Check. . . . . . . . . . . . . . . . . . . HTML 131
Creating a Style Sheet. . . . . . . . . . . . . . . . . . . . . . . . HTML 95

Writing Style Comments . . . . . . . . . . . . . . . . . . . HTML 95 sessioN 2.3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . htMl 132


Defining the Character Encoding. . . . . . . . . . . . . HTML 96 Formatting Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 134
Importing Style Sheets . . . . . . . . . . . . . . . . . . . . HTML 96 Choosing a List Style Type . . . . . . . . . . . . . . . . . HTML 134
Working with Color in CSS . . . . . . . . . . . . . . . . . . . . HTML 97 Creating an Outline Style. . . . . . . . . . . . . . . . . . HTML 134
Color Names. . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 97 Using Images for List Markers . . . . . . . . . . . . . . HTML 137
RGB Color Values . . . . . . . . . . . . . . . . . . . . . . . . . HTML 98 Setting the List Marker Position. . . . . . . . . . . . . HTML 138
HSL Color Values. . . . . . . . . . . . . . . . . . . . . . . . . . HTML 99 Working with Margins and Padding . . . . . . . . . . . . HTML 139

Defining Semi-Opaque Colors . . . . . . . . . . . . . . HTML 100 Setting the Padding Space. . . . . . . . . . . . . . . . . HTML 140

Setting Text and Background Colors . . . . . . . . . HTML 101 Setting the Margin and the Border Spaces . . . . HTML 142
HTML5 and CSS3, 7th Edition, Comprehensive xi

Using Pseudo-Classes and Pseudo-Elements . . . . . HTML 145 Fixed and Fluid Grids . . . . . . . . . . . . . . . . . . . . . HTML 203

Pseudo-Classes. . . . . . . . . . . . . . . . . . . . . . . . . . HTML 145 CSS Frameworks. . . . . . . . . . . . . . . . . . . . . . . . . HTML 204


Pseudo-classes for Hypertext. . . . . . . . . . . . . . . HTML 148 Setting up a Grid. . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 204
Pseudo-Elements . . . . . . . . . . . . . . . . . . . . . . . . HTML 151 Designing the Grid Rows . . . . . . . . . . . . . . . . . . HTML 208
Generating Content with CSS . . . . . . . . . . . . . . . . . HTML 152 Designing the Grid Columns . . . . . . . . . . . . . . . HTML 209
Displaying Attribute Values . . . . . . . . . . . . . . . . HTML 153 Adding the Page Content. . . . . . . . . . . . . . . . . . HTML 210
Inserting Quotation Marks . . . . . . . . . . . . . . . . . . . HTML 154 Outlining a Grid. . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 216
Session 2.3 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 157 Introducing CSS Grids. . . . . . . . . . . . . . . . . . . . . . . HTML 219
Review Assignments . . . . . . . . . . . . . . . . . . . . . . . . HTML 158 Defining a CSS Grid . . . . . . . . . . . . . . . . . . . . . . HTML 219
Case Problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 160 Assigning Content to Grid Cells . . . . . . . . . . . . . HTML 220

Session 3.2 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 223


htMl level ii tutorials
tutorial 3 designing a Page layout sessioN 3.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 224
Creating a Website for a Chocolatier . . . . . . . . . . . . . htMl 169
Positioning Objects . . . . . . . . . . . . . . . . . . . . . . . . . HTML 226

sessioN 3.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 170 The CSS Positioning Styles . . . . . . . . . . . . . . . . . HTML 226

Introducing the display Style . . . . . . . . . . . . . . . HTML 172 Relative Positioning . . . . . . . . . . . . . . . . . . . . . . HTML 226

Creating a Reset Style Sheet. . . . . . . . . . . . . . . . . . HTML 172 Absolute Positioning. . . . . . . . . . . . . . . . . . . . . . HTML 227

Exploring Page Layout Designs. . . . . . . . . . . . . . . . HTML 176 Fixed and Inherited Positioning . . . . . . . . . . . . . HTML 230

Fixed, Fluid, and Elastic Layouts. . . . . . . . . . . . . HTML 176 Using the Positioning Styles. . . . . . . . . . . . . . . . HTML 230

Working with Width and Height . . . . . . . . . . . . . . . HTML 178 Handling Overflow . . . . . . . . . . . . . . . . . . . . . . . . . HTML 240

Setting Maximum and Minimum Dimensions . . HTML 178 Clipping an Element . . . . . . . . . . . . . . . . . . . . . . . . HTML 243

Centering a Block Element . . . . . . . . . . . . . . . . . HTML 181 Stacking Elements . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 244

Vertical Centering . . . . . . . . . . . . . . . . . . . . . . . HTML 182 Session 3.3 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 246

Floating Page Content. . . . . . . . . . . . . . . . . . . . . . . HTML 183 Review Assignments . . . . . . . . . . . . . . . . . . . . . . . . HTML 247

Clearing a Float . . . . . . . . . . . . . . . . . . . . . . . . . HTML 187 Case Problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 249


Refining a Floated Layout. . . . . . . . . . . . . . . . . . HTML 191 tutorial 4 graphic design with css
Creating a Graphic Design for a Genealogy Website . . htMl 257
Working with Container Collapse. . . . . . . . . . . . HTML 195

Session 3.1 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 199 sessioN 4.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 258

Creating Figure Boxes . . . . . . . . . . . . . . . . . . . . . . . HTML 260


sessioN 3.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 200
Exploring Background Styles . . . . . . . . . . . . . . . . . HTML 264
Introducing Grid Layouts . . . . . . . . . . . . . . . . . . . . HTML 202
Tiling a Background Image . . . . . . . . . . . . . . . . HTML 265
Overview of Grid-Based Layouts . . . . . . . . . . . . HTML 202
Attaching the Background Image . . . . . . . . . . . HTML 267
xii New Perspectives Series

Setting the Background Image Position . . . . . . HTML 267 Review Assignments . . . . . . . . . . . . . . . . . . . . . . . . HTML 331

Defining the Extent of the Background . . . . . . . HTML 268 Case Problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 334

Sizing and Clipping an Image . . . . . . . . . . . . . . HTML 269 tutorial 5 designing for the Mobile web
Creating a Mobile Website for a Daycare Center . . . . htMl 341
The background Property. . . . . . . . . . . . . . . . HTML 270

Adding Multiple Backgrounds . . . . . . . . . . . . . . HTML 272 sessioN 5.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . htMl 342


Working with Borders . . . . . . . . . . . . . . . . . . . . . . . HTML 273 Introducing Responsive Design. . . . . . . . . . . . . . . . HTML 344
Setting Border Width and Color. . . . . . . . . . . . . HTML 274 Introducing Media Queries . . . . . . . . . . . . . . . . . . . HTML 345
Setting the Border Design . . . . . . . . . . . . . . . . . HTML 274 The @media Rule. . . . . . . . . . . . . . . . . . . . . . . . . HTML 346
Creating Rounded Corners. . . . . . . . . . . . . . . . . HTML 277 Media Queries and Device Features. . . . . . . . . . HTML 347
Applying a Border Image. . . . . . . . . . . . . . . . . . HTML 281 Applying Media Queries to a Style Sheet . . . . . HTML 349
Session 4.1 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 285 Exploring Viewports and Device Width . . . . . . . . . HTML 352

sessioN 4.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 286 Creating a Mobile Design . . . . . . . . . . . . . . . . . . . . HTML 355

Creating Drop Shadows . . . . . . . . . . . . . . . . . . . . . HTML 288 Creating a Pulldown Menu with CSS . . . . . . . . . HTML 356

Creating a Text Shadow . . . . . . . . . . . . . . . . . . . HTML 288 Testing your Mobile Website . . . . . . . . . . . . . . . HTML 359

Creating a Box Shadow . . . . . . . . . . . . . . . . . . . HTML 290 Creating a Tablet Design . . . . . . . . . . . . . . . . . . . . HTML 363

Applying a Color Gradient . . . . . . . . . . . . . . . . . . . HTML 296 Creating a Desktop Design . . . . . . . . . . . . . . . . . . HTML 367

Creating a Linear Gradient. . . . . . . . . . . . . . . . . HTML 296 Session 5.1 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 371

Gradients and Color Stops . . . . . . . . . . . . . . . . . HTML 299


sessioN 5.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 372
Creating a Radial Gradient. . . . . . . . . . . . . . . . . HTML 301
Introducing Flexible Boxes . . . . . . . . . . . . . . . . . . . HTML 374
Repeating a Gradient . . . . . . . . . . . . . . . . . . . . . HTML 305
Defining a Flexible Box . . . . . . . . . . . . . . . . . . . . HTML 374
Creating Semi-Transparent Objects . . . . . . . . . . . . HTML 307
Cross-Browser Flexboxes . . . . . . . . . . . . . . . . . . HTML 375
Session 4.2 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 309
Setting the Flexbox Flow . . . . . . . . . . . . . . . . . . HTML 375
sessioN 4.3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . htMl 310 Working with Flex Items . . . . . . . . . . . . . . . . . . . . . HTML 377
Transforming Page Objects. . . . . . . . . . . . . . . . . . . HTML 312 Setting the Flex Basis . . . . . . . . . . . . . . . . . . . . . HTML 377
Transformations in Three Dimensions . . . . . . . . HTML 316 Defining the Flex Growth . . . . . . . . . . . . . . . . . . HTML 378
Understanding Perspective . . . . . . . . . . . . . . . . HTML 317 Defining the Shrink Rate . . . . . . . . . . . . . . . . . . HTML 379
Exploring CSS Filters. . . . . . . . . . . . . . . . . . . . . . . . HTML 320 The flex Property . . . . . . . . . . . . . . . . . . . . . . . . HTML 381
Working with Image Maps . . . . . . . . . . . . . . . . . . . HTML 324 Applying a Flexbox Layout . . . . . . . . . . . . . . . . . HTML 382
Defining a Client-Side Image Map . . . . . . . . . . . HTML 324 Reordering Page Content with Flexboxes . . . . . . . . HTML 388
Applying an Image Map. . . . . . . . . . . . . . . . . . . HTML 328 Exploring Flexbox Layouts . . . . . . . . . . . . . . . . . . . HTML 390
Session 4.3 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 330 Aligning Items along the Main Axis . . . . . . . . . . HTML 390
HTML5 and CSS3, 7th Edition, Comprehensive xiii

Aligning Flex Lines . . . . . . . . . . . . . . . . . . . . . . . HTML 391 Creating Row Groups . . . . . . . . . . . . . . . . . . . . . . . HTML 460
Aligning Items along the Cross Axis . . . . . . . . . HTML 392 Creating Column Groups. . . . . . . . . . . . . . . . . . . . . HTML 464
Creating a Navicon Menu . . . . . . . . . . . . . . . . . . . . HTML 394 Exploring CSS Styles and Web Tables. . . . . . . . . . . HTML 467
Session 5.2 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 399 Working with Width and Height. . . . . . . . . . . . . HTML 468
sessioN 5.3. . . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 400 Applying Table Styles to Other
Page Elements . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 472
Designing for Printed Media . . . . . . . . . . . . . . . . . . HTML 402
Tables and Responsive Design. . . . . . . . . . . . . . . . . HTML 474
Previewing the Print Version . . . . . . . . . . . . . . . HTML 402
Designing a Column Layout . . . . . . . . . . . . . . . . . . HTML 478
Applying a Media Query for Printed Output. . . . . HTML 403
Setting the Number of Columns . . . . . . . . . . . . HTML 478
Working with the @page Rule . . . . . . . . . . . . . . . . . HTML 405

Setting the Page Size . . . . . . . . . . . . . . . . . . . . . HTML 405 Defining Columns Widths and Gaps. . . . . . . . . . HTML 481

Using the Page Pseudo-Classes . . . . . . . . . . . . . HTML 406 Managing Column Breaks . . . . . . . . . . . . . . . . . HTML 484

Page Names and the Page Property . . . . . . . . . HTML 406 Spanning Cell Columns . . . . . . . . . . . . . . . . . . . HTML 485

Formatting Hypertext Links for Printing . . . . . . HTML 412 Session 6.2 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 488

Working with Page Breaks. . . . . . . . . . . . . . . . . . . . HTML 415 Review Assignments . . . . . . . . . . . . . . . . . . . . . . . . HTML 489

Preventing Page Breaks . . . . . . . . . . . . . . . . . . . HTML 416 Case Problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 491

Working with Widows and Orphans. . . . . . . . . . HTML 418 tutorial 7 designing a web form
Creating a Survey Form. . . . . . . . . . . . . . . . . . . . . . . . . .htMl 499
Session 5.3 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 421

Review Assignments . . . . . . . . . . . . . . . . . . . . . . . . HTML 422 sessioN 7.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . htMl 500

Case Problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 425 Introducing Web Forms. . . . . . . . . . . . . . . . . . . . . . HTML 502

Parts of a Web Form . . . . . . . . . . . . . . . . . . . . . . HTML 502


htMl level iii tutorials
Forms and Server-Based Programs . . . . . . . . . . HTML 503
tutorial 6 working with tables and columns
Starting a Web Form . . . . . . . . . . . . . . . . . . . . . . . . HTML 504
Creating a Program Schedule for a Radio Station. . . . . . htMl 433
Interacting with the Web Server . . . . . . . . . . . . HTML 505
sessioN 6.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . htMl 434
Creating a Field Set. . . . . . . . . . . . . . . . . . . . . . . . . HTML 507
Introducing Web Tables . . . . . . . . . . . . . . . . . . . . . HTML 436
Marking a Field Set. . . . . . . . . . . . . . . . . . . . . . . HTML 507
Marking Tables and Table Rows. . . . . . . . . . . . . HTML 436
Adding a Field Set Legend . . . . . . . . . . . . . . . . . HTML 508
Marking Table Headings and Table Data . . . . . . HTML 438
Creating Input Boxes. . . . . . . . . . . . . . . . . . . . . . . . HTML 510
Adding Table Borders with CSS . . . . . . . . . . . . . . . HTML 442
Input Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 510
Spanning Rows and Columns . . . . . . . . . . . . . . . . . HTML 447
Input Types and Virtual Keyboards . . . . . . . . . . HTML 514
Creating a Table Caption . . . . . . . . . . . . . . . . . . . . HTML 453
Adding Field Labels. . . . . . . . . . . . . . . . . . . . . . . . . HTML 514
Session 6.1 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 457
Designing a Form Layout. . . . . . . . . . . . . . . . . . . . . HTML 516
sessioN 6.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 458
xiv New Perspectives Series

Defining Default Values and Placeholders . . . . . . . HTML 523 tutorial 8 enhancing a website with Multimedia
Working with Sound, Video, and Animation . . . . . . . . . htMl 585
Session 7.1 Quick Check. . . . . . . . . . . . . . . . . . . . . . HTML 527
sessioN 8.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 586
sessioN 7.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 528
Introducing Multimedia on the Web. . . . . . . . . . . . HTML 588
Entering Date and Time Values . . . . . . . . . . . . . . . . HTML 530
Understanding Codecs and Containers . . . . . . . HTML 588
Creating a Selection List . . . . . . . . . . . . . . . . . . . . . HTML 531
Understanding Plug-Ins . . . . . . . . . . . . . . . . . . . HTML 589
Working with Select Attributes . . . . . . . . . . . . . HTML 533
Working with the audio Element . . . . . . . . . . . . . HTML 591
Grouping Selection Options . . . . . . . . . . . . . . . . HTML 535
Browsers and Audio Formats . . . . . . . . . . . . . . . HTML 591
Creating Option Buttons . . . . . . . . . . . . . . . . . . . . . HTML 537
Applying Styles to the Media Player . . . . . . . . . HTML 594
Creating Check Boxes . . . . . . . . . . . . . . . . . . . . . . . HTML 540
Providing a Fallback to an Audio Clip . . . . . . . . HTML 596
Creating a Text Area Box. . . . . . . . . . . . . . . . . . . . . HTML 542
Exploring Embedded Objects . . . . . . . . . . . . . . . . . HTML 598
Session 7.2 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 545
Plug-In Attributes. . . . . . . . . . . . . . . . . . . . . . . . HTML 598
sessioN 7.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 546
Plug-Ins as Fallback Options . . . . . . . . . . . . . . . HTML 599
Entering Numeric Data . . . . . . . . . . . . . . . . . . . . . . HTML 548
Session 8.1 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 599
Creating a Spinner Control . . . . . . . . . . . . . . . . HTML 548
sessioN 8.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 600
Creating a Range Slider . . . . . . . . . . . . . . . . . . . HTML 550
Exploring Digital Video . . . . . . . . . . . . . . . . . . . . . . HTML 602
Suggesting Options with Data Lists . . . . . . . . . . . . HTML 553
Video Formats and Codecs. . . . . . . . . . . . . . . . . HTML 602
Working with Form Buttons. . . . . . . . . . . . . . . . . . . HTML 556
Using the HTML5 video Element . . . . . . . . . . . . . HTML 603
Creating a Command Button . . . . . . . . . . . . . . . HTML 556
Adding a Text Track to Video . . . . . . . . . . . . . . . . . HTML 607
Creating Submit and Reset Buttons . . . . . . . . . . HTML 556
Making Tracks with WebVTT . . . . . . . . . . . . . . . HTML 608
Designing a Custom Button . . . . . . . . . . . . . . . . HTML 559
Placing the Cue Text. . . . . . . . . . . . . . . . . . . . . . HTML 611
Validating a Web Form . . . . . . . . . . . . . . . . . . . . . . HTML 559
Applying Styles to Track Cues . . . . . . . . . . . . . . HTML 612
Identifying Required Values. . . . . . . . . . . . . . . . HTML 559
Using Third-Party Video Players . . . . . . . . . . . . . . . HTML 616
Validating Based on Data Type. . . . . . . . . . . . . . HTML 561
Exploring the Flash Player . . . . . . . . . . . . . . . . . HTML 617
Testing for a Valid Pattern . . . . . . . . . . . . . . . . . HTML 562
Embedding Videos from YouTube. . . . . . . . . . . . HTML 618
Defining the Length of the Field Value. . . . . . . . HTML 564
HTML5 Video Players . . . . . . . . . . . . . . . . . . . . . HTML 619
Applying Inline Validation. . . . . . . . . . . . . . . . . . . . HTML 565
Session 8.2 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 621
Using the focus Pseudo-Class . . . . . . . . . . . . . HTML 565

Pseudo-Classes for Valid and Invalid Data . . . . . HTML 567 sessioN 8.3. . . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 622

Session 7.3 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 570 Creating Transitions with CSS. . . . . . . . . . . . . . . . . HTML 624

Review Assignments . . . . . . . . . . . . . . . . . . . . . . . . HTML 571 Introducing Transitions . . . . . . . . . . . . . . . . . . . HTML 624

Case Problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 574 Setting the Transition Timing. . . . . . . . . . . . . . . HTML 626
HTML5 and CSS3, 7th Edition, Comprehensive xv

Delaying a Transition . . . . . . . . . . . . . . . . . . . . . HTML 629 Changing Properties and Applying Methods . . . . . HTML 688
Creating a Hover Transition . . . . . . . . . . . . . . . . HTML 629 Object Properties . . . . . . . . . . . . . . . . . . . . . . . . HTML 688
Animating Objects with CSS . . . . . . . . . . . . . . . . . . HTML 634 Applying a Method. . . . . . . . . . . . . . . . . . . . . . . HTML 688
The @keyframes Rule . . . . . . . . . . . . . . . . . . . HTML 634 Writing HTML Code. . . . . . . . . . . . . . . . . . . . . . . . . HTML 689
Applying an Animation . . . . . . . . . . . . . . . . . . . HTML 637 Working with Variables . . . . . . . . . . . . . . . . . . . . . . HTML 693
Controlling an Animation . . . . . . . . . . . . . . . . . . HTML 640 Declaring a Variable . . . . . . . . . . . . . . . . . . . . . . HTML 693
Session 8.3 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 651 Variables and Data Types . . . . . . . . . . . . . . . . . . HTML 694
Review Assignments . . . . . . . . . . . . . . . . . . . . . . . . HTML 652 Using a Variable . . . . . . . . . . . . . . . . . . . . . . . . . HTML 695
Case Problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 655 Working with Date Objects . . . . . . . . . . . . . . . . . . . HTML 695
tutorial 9 getting started with Javascript Creating a Date Object. . . . . . . . . . . . . . . . . . . HTML 696
Creating a Countdown Clock. . . . . . . . . . . . . . . . . . . . . htMl 665
Applying Date Methods . . . . . . . . . . . . . . . . . . HTML 697
sessioN 9.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 666 Setting Date and Time Values . . . . . . . . . . . . . . HTML 700
Introducing JavaScript . . . . . . . . . . . . . . . . . . . . . . HTML 668 Session 9.2 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 701
Server-Side and Client-Side Programming . . . . HTML 668
sessioN 9.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 702
The Development of JavaScript . . . . . . . . . . . . . HTML 669
Working with Operators and Operands . . . . . . . . . HTML 704
Working with the script Element . . . . . . . . . . . . HTML 670
Using Assignment Operators . . . . . . . . . . . . . . . HTML 704
Loading the script Element . . . . . . . . . . . . . . HTML 670
Calculating the Days Left in the Year . . . . . . . . . HTML 705
Inserting the script Element . . . . . . . . . . . . . HTML 671
Working with the Math Object . . . . . . . . . . . . . . . . HTML 707
Creating a JavaScript Program. . . . . . . . . . . . . . . . HTML 673
Using Math Methods . . . . . . . . . . . . . . . . . . . . . HTML 707
Adding Comments to your JavaScript Code . . . HTML 673
Using Math Constants . . . . . . . . . . . . . . . . . . . . HTML 712
Writing a JavaScript Command . . . . . . . . . . . . . HTML 674
Working with JavaScript Functions. . . . . . . . . . . . . HTML 714
Understanding JavaScript Syntax . . . . . . . . . . . HTML 675
Calling a Function. . . . . . . . . . . . . . . . . . . . . . . . HTML 716
Debugging your Code . . . . . . . . . . . . . . . . . . . . . . . HTML 677
Creating a Function to Return a Value . . . . . . . . HTML 717
Opening a Debugger . . . . . . . . . . . . . . . . . . . . . HTML 677
Running Timed Commands . . . . . . . . . . . . . . . . . . . HTML 718
Inserting a Breakpoint . . . . . . . . . . . . . . . . . . . . HTML 679
Working with Time-Delayed Commands . . . . . . HTML 718
Applying Strict Usage of JavaScript . . . . . . . . . HTML 680
Running Commands at Specified Intervals . . . . HTML 718
Session 9.1 Quick Check. . . . . . . . . . . . . . . . . . . . . . HTML 681
Controlling How JavaScript Works with
Numeric Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 720
sessioN 9.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 682
Handling Illegal Operations . . . . . . . . . . . . . . . . HTML 720
Introducing Objects . . . . . . . . . . . . . . . . . . . . . . . . HTML 684
Defining a Number Format . . . . . . . . . . . . . . . . HTML 721
Object References . . . . . . . . . . . . . . . . . . . . . . . HTML 685
Converting Between Numbers and Text . . . . . . HTML 721
Referencing Object Collections . . . . . . . . . . . . . HTML 685

Referencing an Object by ID and Name . . . . . . HTML 687 Session 9.3 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 723
xvi New Perspectives Series

Review Assignments . . . . . . . . . . . . . . . . . . . . . . . . HTML 724 Introducing Conditional Statements. . . . . . . . . . . . HTML 772

Case Problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 726 Exploring the if Statement. . . . . . . . . . . . . . . . HTML 773

tutorial 10 exploring arrays, loops, and conditional Nesting if Statements . . . . . . . . . . . . . . . . . . . HTML 775
statements Exploring the if else Statement. . . . . . . . . . . HTML 777
Creating a Monthly Calendar . . . . . . . . . . . . . . . . . . . . .htMl 735
Using Multiple else if Statements . . . . . . . . HTML 778
sessioN 10.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 736
Completing the Calendar App . . . . . . . . . . . . . . . . HTML 780
Introducing the Monthly Calendar . . . . . . . . . . . . . HTML 738
Setting the First Day of the Month. . . . . . . . . . . HTML 781
Reviewing the Calendar Structure . . . . . . . . . . . HTML 739
Placing the First Day of the Month. . . . . . . . . . . HTML 782
Adding the calendar() Function . . . . . . . . . . . . . HTML 740
Writing the Calendar Days . . . . . . . . . . . . . . . . . HTML 783
Introducing Arrays . . . . . . . . . . . . . . . . . . . . . . . . . HTML 741
Highlighting the Current Date . . . . . . . . . . . . . . HTML 785
Creating and Populating an Array . . . . . . . . . . . HTML 742
Displaying Daily Events . . . . . . . . . . . . . . . . . . . HTML 787
Working with Array Length . . . . . . . . . . . . . . . . HTML 745
Managing Program Loops and
Reversing an Array . . . . . . . . . . . . . . . . . . . . . . . HTML 747 Conditional Statements. . . . . . . . . . . . . . . . . . . . . . HTML 790

Sorting an Array. . . . . . . . . . . . . . . . . . . . . . . . . HTML 748 Exploring the break Command . . . . . . . . . . . . HTML 790

Extracting and Inserting Array Items . . . . . . . . HTML 749 Exploring the continue Command . . . . . . . . . HTML 790

Using Arrays as Data Stacks. . . . . . . . . . . . . . . . HTML 750 Exploring Statement Labels . . . . . . . . . . . . . . . . HTML 791

Session 10.1 Quick Check. . . . . . . . . . . . . . . . . . . . . HTML 753 Session 10.3 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 793

Review Assignments . . . . . . . . . . . . . . . . . . . . . . . . HTML 794


sessioN 10.2. . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 754
Case Problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . HTML 796
Working with Program Loops . . . . . . . . . . . . . . . . . HTML 756
appendix a color Names with color values,
Exploring the for Loop . . . . . . . . . . . . . . . . . . . HTML 756
and htMl character entities . . . . . . . . . . . . . . htMl a1
Exploring the while Loop. . . . . . . . . . . . . . . . . HTML 758
appendix B htMl elements and attributes . . . . htMl B1
Exploring the do/while Loop . . . . . . . . . . . . . HTML 759
appendix c cascading styles and selectors . . . htMl c1
Comparison and Logical Operators . . . . . . . . . . . . HTML 760
appendix d Making the web
Program Loops and Arrays . . . . . . . . . . . . . . . . . . . HTML 761 More accessible . . . . . . . . . . . . . . . . . . . . . . . .htMl d1
Array Methods to Loop Through Arrays. . . . . . . HTML 764 appendix e designing for the web . . . . . . . . . . htMl e1
Running a Function for Each Array Item . . . . . . HTML 765 appendix f Page validation with xhtMl . . . . . htMl f1
Mapping an Array . . . . . . . . . . . . . . . . . . . . . . . HTML 765
glossarY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ref 1
Filtering an Array . . . . . . . . . . . . . . . . . . . . . . . . HTML 766
iNdex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .ref 11
Session 10.2 Quick Check . . . . . . . . . . . . . . . . . . . . HTML 769

sessioN 10.3. . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 770


TUToriAL
1
O b j ec ti v es Getting Started
session 1.1
• Explore the history of the web
• Create the structure of an
with HTML5
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, a
• Mark page structures with restaurant owner and now food truck vendor in Charlotte, North
sectioning elements Carolina that specializes in Thai dishes. Sajja has hired you to
• Organize page content with develop the company’s website. The website will display information
grouping elements about Curbside Thai including the truck’s daily locations, menu,
• Mark content with text-level catering opportunities, and contact information. Sajja wants the
elements pages to convey the message that customers will get the same
• Insert inline images great food and service whether they order in the restaurant or from
• Insert symbols based on
the food truck. Some of the materials for these pages have already
character codes
been completed by a former employee and Sajja needs you to
session 1.3 finish the job by converting that work into a collection of web page
• Mark content using lists documents. To complete this task, you’ll learn how to write and edit
• Create a navigation list HTML5 code and how to get your HTML files ready for display on
• Link to files within a website the World Wide Web.
with hypertext links
• Link to e-mail addresses and
telephone numbers

sTArTinG DATA FiLes

html01 tutorial review case1 case2

ct_catering_txt.html mp_catering_txt.html jtc_index_txt.html ms_euler_txt.html


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

case3 case4 demo

dr_faq_txt.html hg_ alliance _txt.html demo_characters.html


dr_index_txt.html hg_index_txt.html demo_html.html
dr_info_txt.html hg_ towers_txt.html + 4 files
+ 9 files + 4 files

HTML 1
HTML 2 HTML and CSS | Tutorial 1 Getting Started with HTML5

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.

© 2016 Cengage Learning;


A closing tag marks the © Kzenon/Shutterstock.com;
end of the element © martiapunts/Shutterstock.com;
content; this tag marks the © Brian A Jackson/Shutterstock.com;
end of the page footer. © sayhmog/Shutterstock.com;
© rangizzz/Shutterstock.com
Tutorial 1 Getting Started with HTML5 | HTML 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.
HTML 4 HTML and CSS | Tutorial 1 Getting Started with HTML5

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 has
his or her own printing press; 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 and/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 is a network host that provides printing
services and a file server is a host that provides storage space for saving and retrieving
files. The device that receives 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. You might be using such a network to access your data files for
this tutorial.
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. To meet this need, they 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 that users activate
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 particular document, information
source, or 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 with
other networks 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.
Tutorial 1 Getting Started with HTML5 | HTML and CSS HTML 5

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
document from the web server and renders it locally in a form that is 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 both the tagging of 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 which, 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 HtML5. Unlike XHTML 2.0,
HTML5 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
HTML 6 HTML and CSS | Tutorial 1 Getting Started with HTML5

and the W3C issued a new charter for WHATWG to develop HTML5 as the de facto
standard for the next generation of HTML. Thus today, HTML5 is the current version of
the HTML language and it is supported by all current browsers and devices. You can
learn more about WHATWG and its current projects at www.whatwg.org.
As HTML has evolved, features and code found in earlier versions of the language
You can find out which are often deprecated, or phased out, and while deprecated features might not be part
browsers and browser of HTML5, that doesn’t mean that you won’t encounter them in your work—indeed, if
versions support the you are maintaining older websites, you will often need to interpret code from earlier
features of HTML5 by versions of HTML. Moreover, there are still many older browsers and devices in active
going to the website
caniuse.com.
use that do not support HTML5. Thus, a major challenge for website designers is
writing code that takes advantage of HTML5 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 The current HTML version providing support for mobile
design, semantic page elements, column layout, form
validation, offline storage, and enhanced multimedia
© 2016 Cengage Learning

This book focuses on HTML5, but you will also review some of the specifications
for HTML 4.01 and XHTML 1.1. Note that in the figures that follow, code that was
introduced starting with HTML5 will be identified with the label [HTML5].

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. Some of the more popular HTML
editors are Notepad++ (notepad-plus-plus.org), UltraEdit (www.ultraedit.com),
CoffeeCup (www.coffeecup.com), BBEdit (www.barebones.com) and ConTEXT
(www.contexteditor.org). These editors include such features as syntax checking to
weed out errors, automatic insertion of HTML code, and predesigned templates with
the initial code already prepared for you.
Tutorial 1 Getting Started with HTML5 | HTML and CSS HTML 7

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
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.

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
HTML5 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.

Supporting the Mobile Web


Currently, the most important factor impacting website design is the increased use
of mobile devices to access the Internet. By the end of 2014, the number of mobile
Internet users exceeded the number of users accessing the web through laptop or
desktop devices. The increased reliance on mobile devices means that web designers
must be careful to tailor their websites to accommodate both the desktop and mobile
experience. You’ll explore the challenge of designing for the mobile web in more detail
in Tutorial 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.
HTML 8 HTML and CSS | Tutorial 1 Getting Started with HTML5

To open the ct_start.html file:


◗ 1. Use the editor of your choice to open the ct_start.html file from the
All HTML files have the file html01  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.
◗ 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 to display
the content. For HTML5, the doctype is entered as
<!DOCTYPE html>

You might also see the doctype entered in lowercase letters as


<!doctype html>
Tutorial 1 Getting Started with HTML5 | HTML and CSS HTML 9

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, as a result,
you should always put your HTML5 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. For example, the
following code marks a paragraph element:
<p>Welcome to Curbside Thai.</p>

Here the <p></p> tags are the starting and ending HTML tags that 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>

For example, the following br element, which is used to indicate the presence of a
line break in the text, is entered with the one-sided tag:
<br />

Note that, while this code could also be entered as <br>, the ending slash /> form is
the required form in XHTML documents as well as other markup languages. While
HTML5 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 in the future. We’ll
follow the /> convention in the code in this book.
Elements can contain other elements, which are called nested elements. For
example, in the following code, the em element (used to mark emphasized text) is
nested within the paragraph element by placing the em markup tag completely within
the p markup tag.
HTML 10 HTML and CSS | Tutorial 1 Getting Started with HTML5

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

Note that 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 syntax 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 look at how they’re used 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, which marks
the entire document. Within the html element is the head element used to mark
information about the document itself and the body element used to mark the content
that will appear in 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 that mark the content
of 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 HTML5 | HTML and CSS HTML 11

Introducing Element Attributes


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

HTML editors will often color-code attributes and their values. The attributes in
Figure 1-2 are rendered in a blue font while the corresponding attribute values are
rendered in magenta.
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 [HTML5]
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
© 2016 Cengage Learning

Some attributes do not require a value, so, as a result, HTML supports attribute
minimization in which no value is shown in the document. 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 HTML5 differs from other markup
languages such as XHTML in which minimization is not allowed and all attributes must
have attribute values.
Another random document with
no related content on Scribd:
And who will sit in Nóvgorod?”
There stepped forward Diví Murza, son of Ulán:
“Listen, our lord, Crimea’s tsar!
You, our lord, shall sit in stone-built Moscow,
And your son in Vladímir,
And your nephew in Súzdal,
And your relative in Zvenígorod,
And let the equerry hold old Ryazán,
But to me, O lord, grant Nóvgorod:
There, in Nóvgorod, lies my luck.”
The voice of the Lord called out from heaven:
“Listen, you dog, Crimea’s tsar!
Know you not the tsarate of Muscovy?
There are in Moscow seventy Apostles,[117]
Besides the three Sanctified;
And there is in Moscow still an orthodox Tsar.”
And you fled, you dog, Crimea’s tsar,
Not over the highways, nor the main road,
Nor following the black standard.

THE SONG OF THE PRINCESS KSÉNIYA BORÍSOVNA [118]

There weepeth a little bird,


A little white quail:
“Alas, that I so young must grieve!
They wish to burn the green oak,
To destroy my little nest,
To kill my little ones,
To catch me, quail.”
In Moscow the Princess weepeth:
“Alas that I so young must grieve!
For there comes to Moscow the traitor,
Gríshka Otrépev Rozstríga,[119]
Who wants to take me captive,
And having captured make me a nun,
To send me into the monastery.
But I do not wish to become a nun,
To go into a monastery:
I shall keep my dark cell open,
To look at the fine fellows.
O our beautiful corridors!
Who will walk over you
After our tsarian life
And after Borís Godunóv?
O our beautiful palace halls!
Who will be sitting in you
After our tsarian life
And after Borís Godunóv?”
And in Moscow the Princess weepeth,
The daughter of Borís Godunóv:
“O God, our merciful Saviour!
Wherefore is our tsardom perished,—
Is it for father’s sinning,
Or for mother’s not praying?
And you beloved palace halls!
Who will rule in you,
After our tsarian life?
Fine stuffs of drawn lace!—
Shall we wind you around the birches?
Fine gold-worked towels!
Shall we throw you into the woods?
Fine earrings of hyacinth
Shall we hang you on branches,
After our tsarian life,
After the reign of our father,
Glorious Borís Godunóv?
Wherefore comes to Moscow Rozstríga,
And wants to break down the palaces,
And to take me, princess, captive,
And to send me to Ustyúzhna Zheléznaya,
To make me, princess, a nun,
To place me behind a walled garden?
Why must I grieve,
As they take me to the dark cell,
And the abbess gives me her blessing?”

THE RETURN OF PATRIARCH FILARÉT TO MOSCOW[120]

The tsarate of Muscovy was happy


And all the holy Russian land.
Happy was the sovereign, the orthodox Tsar,
The Grand Duke Mikhaíl Fedórovich,
For he was told that his father had arrived,
His father Filarét Nikítich,
From the land of the infidel, from Lithuania.
He had brought back with him many princes and boyárs,
He had also brought the boyár of the Tsar,
Prince Mikhaíl Borísovich Sheyn.
There had come together many princes, boyárs, and dignitaries,
In the mighty tsarate of Muscovy:
They wished to meet Filarét Nikítich
Outside the famous stone-built Moscow.
’Tis not the red sun in its course,—
’Tis the orthodox Tsar that has gone out,
To meet his father dear,
Lord Filarét Nikítich.
With the Tsar went his uncle,
Iván Nikítich the boyár.—
“The Lord grant my father be well,
My father, lord Filarét Nikítich.”
They went not into the palace of the Tsar,
They went into the cathedral of the Most Holy Virgin,
To sing an honourable mass.
And he blessed his beloved child:
“God grant the orthodox Tsar be well,
Grand Duke Mikhaíl Fedórovich!
And for him to rule the tsarate of Muscovy
And the holy Russian land.

FOOTNOTES:

[116] Having destroyed almost the whole of Moscow by fire in


1572, Devlét-Giréy made again an incursion the next year. He
was so sure of an easy victory, that the streets of Moscow, so
Kúrbski tells, were alotted in advance to the Murzas. He came
with an army of 120,000 men, and left on the field of battle
100,000.
[117] Either churches or images of the apostles; a similar
interpretation holds for the next line.
[118] She was shorn a nun by order of the False Demetrius,
and was sent to a distant monastery.
[119] Rozstríga means “he who has abandoned his tonsure.”
[120] Filarét Nikítich, the father of Mikhaíl Fedórovich, returned
from his Lithuanian captivity in 1619 and was at once proclaimed
Patriarch.
Yúri Krizhánich. (1617-about 1677.)
Krizhánich was a Croatian who had studied at the Croatian
Seminary at Vienna, at the university of Bologna, and at the
Greek College of St. Athanasius at Rome, where he came in
contact with some Russians. He early dreamed of a union of
all the Slavic nations under the rule of Russia, and in 1657 he
went to Southern Russia, where he began a propaganda
among the Cossacks in favour of a union with that country.
Two years later he appeared in Moscow, where his Catholic
religion and his efforts at introducing a Western culture
brought him into disrepute, and he was at once banished to
Siberia, where he lived until the year 1676. He composed a
large number of works on an Universal Slavic language, on
the Russian empire in the seventeenth century, and on the
union of the Churches, writing not in Russian, but in a strange
mixture of several Slavic languages, of his own invention. In
these he developed a strong Panslavism, full of hatred of
everything foreign, except foreign culture, and expressed high
hopes for Russia’s future greatness. His works are said to
have been used by Peter the Great, but they were not
published until 1860.

POLITICAL REASONS FOR THE UNION OF THE CHURCHES

The sixth reason for my contention is of a political nature, and


refers to the nation’s weal. For this discord of the Churches is even
now the cause of Doroshénko’s rebellion and the Turkish invasion,
and continuation of the present war, and has from the beginning
been the cause of much evil. The Poles have an ancient adage: Aut
Moscovia Polonizat, aut Polonia Moscovizat, i. e., Either Moscow
shall become Polish, or Poland shall be a part of the Russian
empire. It is written in the histories of other nations, and the advisers
of the Tsar know it, that in the days of Feódor Ivánovich and later
there have been many congresses held and embassies sent for the
purpose of securing a Russian ruler for Poland and Lithuania. There
is no doubt but that Poland and Lithuania would have become
possessions of the Russian Tsars, if it were not for the division of the
Churches. And there would not have been many old and new wars,
nor bloodshed, in which so many hundreds of thousands of innocent
people have perished by the sword, and have been led into
Mussulman captivity. And the Russian nation would have long ago
been far advanced in profane and political sciences that are so
necessary for all well-educated persons, and would not be scorned
and ridiculed and hated by the European nations for its barbarism.
Nor would it suffer such unbearable disgrace and losses in war and
commerce from the Germans and Crimeans, as it is suffering now.
Book knowledge and political wisdom is a leaven of the mind, and a
fast friendship with the Poles and Lithuanians would have made the
Russian nation more renowned and more feared by the surrounding
peoples, and richer in all earthly possessions.

ON KNOWLEDGE

Kings must instruct their subjects, parents their children, how to


obtain knowledge. The time has come for our nation to be instructed
in various branches, for God has in His mercy and kindness uplifted
through Russia a Slavic kingdom to glory, power and majesty, such
as for splendour has never existed before among us. We observe
with other nations that as soon as a kingdom rises to higher
importance, the sciences and arts at once begin to flourish among
them. We, too, must learn, for under the honoured rule of the
Righteous Tsar and Great King Alexis Mikháylovich we have an
opportunity to wipe off the mould of our ancient barbarism, to acquire
various sciences, to adopt a better organisation of society, and to
reach a higher well-being.

ON FOREIGNERS

We are not possessed of an innate vivacity, nor praiseworthy


national characteristics, nor sincerity of heart. For people who have
such pride do not allow foreigners to command them, except by
force, whereas our nation of its own free will invites foreigners to
come to its country. Not one people under the sun has since the
beginning of the world been so abused and disgraced by foreigners
as we Slavs have been by the Germans. Our whole Slavic nation
has been subject to this kind of treatment; everywhere we have upon
our shoulders Germans, Jews, Scotchmen, Gypsies, Armenians,
Greeks and merchants of other nationalities, who suck our blood. In
Russia you will see nowhere any wealth, except in the Tsar’s
treasury; everywhere there is dire, bare poverty.
Grigóri Kotoshíkhin. (1630-1667.)
Grigóri Kotoshíkhin was a clerk, and later a scribe
(podyáchi) in the Department of Legations, a kind of Foreign
Office. He had been frequently employed as an ambassador
in connection with various treaties between Russia and
Sweden and Poland. While at Moscow, he had been guilty of
some dishonesty to his own country by giving certain secrets
of State to the Swedish ambassador; but that was an offence
not uncommon at Moscow, where patriotism was seldom of a
disinterested character. In 1664 he was sent out with the
Russian army that was then operating against Poland. Shortly
after, its two generals, Cherkásski and Prozoróvski, were
recalled, and Dolgorúki was sent in their place. The latter tried
to get Kotoshíkhin’s aid in denouncing his two predecessors
for traitorous actions, but Kotoshíkhin refused. Fearing the
wrath of Dolgorúki, he fled, first to Poland, and then, through
Prussia and Lubeck, to Sweden. He settled in Stockholm,
where he was employed in a semi-official capacity in the
Foreign Office. In a fit of intoxication he killed his host, who
was the official Russian translator of Sweden, and for this
crime he was beheaded.
Kotoshíkhin had evidently formed the plan of writing about
Russian customs before his arrival in Stockholm, but he was
also encouraged by distinguished Swedish statesmen, who
hoped to find important information about Russia in his work.
In his capacity of Legation scribe Kotoshíkhin had an
excellent opportunity to become intimately acquainted with
the immediate surroundings of the Tsar; but he supplemented
his knowledge by a clear insight, which he had gained in his
intercourse with other nations. There is no other work of Old
Russia that gives so detailed an account of contemporary
society. Kotoshíkhin’s work was first discovered in 1840,
though several manuscript translations in Swedish were
known to be extant in various libraries.
THE EDUCATION OF THE PRINCES

FROM CHAP. 1.

For the bringing up of the Tsarévich or Tsarévna they select from


among the women of all ranks a good, pure, sweet-tempered and
healthy woman, and that woman resides for a year in the Upper
Palace, in the apartments of the Tsarítsa. At the expiration of the
year, the husband of that woman, if she be of noble origin, is made
governor of a city, or receives some lands in perpetuity; if she be a
scribe’s, or some other serving-man’s wife, he is promoted and
granted a goodly salary; if he be a countryman, he is given a good
sum, and both are freed from the taxes and other imposts of the Tsar
during their whole lives. The Tsarévich and Tsarévna have also a
chief-nurse to look after them, a distinguished boyár’s wife,—an old
widow, and a nurse and other servants. When the Tsarévich reaches
the age of five, he is put in the keeping of a renowned boyár, a quiet
and wise man, and the latter has for a companion a man from the
lower ranks; they also choose from among the children of the boyárs
a few of the same age as the Tsarévich, to be his servants and
butlers. When the time arrives to teach the Tsarévich to read and
write, they select teachers from the instructed people, who are of a
quiet disposition and not given to drinking; the teacher of writing is
chosen from among the Legation scribes; they receive instruction in
Russia in no other language, neither Latin, Greek, German nor any
other, except Russian.
The Tsaréviches and Tsarévnas have each separate apartments
and servants to look after them. No one is permitted to see the
Tsarévich before his fifteenth year, except those people who serve
him, and the boyárs and Near People[121]; but after fifteen years he
is shown to all people, as his father goes with him to church or to
entertainments. When the people find out that he has been
presented, they come on purpose from many cities to get a look at
him. As the Tsaréviches, when they are young, and the elder and
younger Tsarévnas go to church, there are borne cloth screens all
around them, so that they cannot be seen; likewise, they cannot be
seen when they stand in church, except by the clergy, for they are
surrounded in church with taffeta, and there are few people in church
during that time but boyárs and Near People. Similarly, when they
travel to the monasteries to pray, their carriages are covered with
taffeta. For their winter rides, the Tsarítsa and Tsarévnas use
kaptánas, that is, sleighs in the shape of small huts that are covered
with velvet or red cloth, with doors at both sides, with mica windows
and taffeta curtains; for their summer rides they use kolymágas that
are also covered with cloth; these are entered by steps and are
made like simple carts on wheels, and not like carriages that hang
down on leather straps. These kolymágas and kaptánas have two
shafts, and are without an axle; only one horse is hitched in them,
with other horses in tandem.

PRIVATE LIFE OF THE BOYÁRS AND OF OTHER RANKS (CHAP. 13)

Boyárs and Near People live in their houses, both of stone and
wood, that are not well arranged; their wives and children live all in
separate rooms. Only a few of the greater boyárs have their own
churches in their courts; and those of the high and middle boyárs
who have no churches of their own, but who are permitted to have
priests at their houses, have the matins and vespers and other
prayers said in their own apartments, but they attend mass in any
church they may choose; they never have the mass in their own
houses. The boyárs and Near People pay their priests a yearly
salary, according to agreement; if the priests are married people,
they receive a monthly allowance of food and drink, but the widowed
priests eat at the same table with their boyárs.
On church holidays, and on other celebrations, such as name
days, birthdays and christenings, they frequently celebrate together.
It is their custom to prepare simple dishes, without seasoning,
without berries, or sugar, without pepper, ginger or other spices, and
they are little salted and without vinegar. They place on the table one
dish at a time; the other dishes are brought from the kitchen and are
held in the hands by the servants. The dishes that have little vinegar,
salt and pepper are seasoned at the table; there are in all fifty to one
hundred such dishes.
The table manners are as follows: before dinner the hosts order
their wives to come out and greet their guests. When the women
come, they place themselves in the hall, or room, where the guests
are dining, at the place of honour,[122] and the guests stand at the
door; the women greet the guests with the small salute,[123] but the
guests bow to the ground. Then the host makes a low obeisance to
his guests and bids them kiss his wife. At the request of his guests,
the host kisses his wife first; then the guests make individual bows
and, stepping forward, kiss his wife and, walking back again, bow to
her once more; she makes the small salute each time she kisses a
guest. Then the hostess brings each guest a glass of double-or
treble-spiced brandy, the size of the glass being a fourth, or a little
more, of a quart. The host makes as many low obeisances as there
are guests, asking each one in particular to partake of the brandy
which his wife is offering them. By the request of the guests, the host
bids his wife to drink first, then he drinks himself, and then the guests
are served; the guests make a low obeisance before drinking, and
also after they have drunk and as they return the glass. To those that
do not drink brandy, a cup of Rumney or Rhine wine, or some other
liquor, is offered.
After this drinking the hostess makes a bow to the guests and
retires to her apartments to meet her guests, the wives of the boyárs.
The hostess and the wives of the guests never dine with the men,
except at weddings; an exception is also made when the guests are
near relatives and there are no outsiders present at the dinner.
During the dinner, the host and guests drink after every course a cup
of brandy, or Rumney or Rhine wine, and spiced and pure beer, and
various kinds of meads. When they bring the round cakes to the
table, the host’s daughters-in-law, or married daughters, or the wives
of near relatives come into the room, and the guests rise and,
leaving the table, go to the door and salute the women; then the
husbands of the women salute them, and beg the guests to kiss their
wives and drink the wine they offer. The guests comply with their
request and return to the table, while the women go back to their
apartments. After dinner the host and guests drink more freely each
other’s healths, and drive home again. The boyárs’ wives dine and
drink in the same manner in their own apartments, where there are
no men present.
When a boyár or Near Man is about to marry off his son, or
himself, or a brother, or nephew, or daughter, or sister, or niece, he,
having found out where there is a marriageable girl, sends his
friends, men or women, to the father of that girl, to say that such and
such a one had sent them to inquire whether he would be willing to
give his daughter or relative to him or his relative, and what the girl’s
dowry would be in the trousseau, money, patrimony and serfs. If the
person addressed is willing to give him his daughter, or relative, he
replies to the inquiry that he intends to marry off the girl, only he has
to consider the matter with his wife and family, and that he will give a
definite answer on a certain day; but if he does not wish to give him
the girl, knowing that he is a drunkard, or fast, or has some other bad
habit, he will say at once that he will not give him the girl, or he will
find some excuse for refusing the request.
Having taken counsel with his wife and family, and having decided
to give him the girl, he makes a detailed list of her dowry, in money,
silver and other ware, dresses, patrimony and serfs, and sends it to
the people who had come to him from the prospective bridegroom,
and they, in their turn, take it to the bridegroom. Nothing is told of the
matter to the prospective bride, who remains in ignorance thereof.
The dowry of the bride appearing satisfactory, the groom sends his
people to the bride’s parents, to ask them to present the girl. The
bride’s parents reply that they are willing to show their daughter, only
not to the prospective groom, but to his father, mother, sister or near
female relative, in whom the groom may have special confidence.
On the appointed day the groom sends his mother or sister to
inspect the bride; the bride’s parents make preparations for that day,
attire their daughter in a fine garment, invite their relatives to dinner,
and seat their daughter at the table.
When the inspectress arrives, she is met with the honour due her,
and is placed at the table near the bride. Sitting at the table, the
inspectress converses with the girl on all kinds of subjects, in order
to try her mind and manner of speech, and closely watches her face,
eyes and special marks, in order to bring a correct report to the
bridegroom; having stayed a short time, she returns to the
bridegroom. If the inspectress takes no liking to the bride, having
discovered that she is silly, or homely, or has imperfect eyes, or is
lame, or a poor talker, and so reports to the groom, he gives her up,
and that is the last of it. But if the bride has found favour in the
inspectress’s eyes, and she tells the groom that the girl is good and
clever, and perfect in speech and all things, the groom sends his
former friends again to the girl’s parents, telling them that he likes
their daughter, and that he wishes to come to a parley to write the
marriage contract, in order to marry her on a certain date. The
bride’s parents send word to the groom through his trusted people
that he should come to the parley with a few of his friends in whom
he has most confidence on a certain day, in the forenoon or
afternoon.
On the appointed day the groom puts on his best clothes, and
drives with his father, or near relatives, or friends whom he loves
best to the bride’s parents. Upon arrival, the bride’s parents and her
near relatives meet them with due honour, after which they go into
the house and seat themselves according to rank. Having sat a
while, the groom’s father or other relative remarks that they have
come for the good work, as he has bid them; the host answers that
he is glad to see them, and that he is ready to take up the matter.
Then both sides begin to discuss all kinds of marriage articles and to
set the day for the wedding according to how soon they can get
ready for it, in a week, a month, half a year, a year, or even more.
Then they enter their names and the bride’s name and the names of
witnesses in the marriage contract, and it is agreed that he is to take
the girl on a certain date, without fail, and that the girl is to be turned
over to him on that date, without fail; and it is provided in that
contract that if the groom does not take the girl on the appointed day,
or the father will not give him his daughter on that day, the offending
party has to pay 1000, or 5000, or 10,000 roubles, as the agreement
may be. Having stayed a while, and having eaten and drunk, they
return home, without having seen the bride, and without the bride
having seen the groom; but the mother, or married sister, or wife of
some relative comes out to present the groom with some embroidery
from the bride.
If after that parley the groom finds out something prejudicial to the
bride, or someone interested in the groom tells him that she is deaf,
or mute, or maimed, or has some other bad characteristic, and the
groom does not want to take her,—and the parents of the bride
complain about it to the Patriarch that he has not taken the girl
according to the marriage articles, and does not want to take her,
and thus has dishonoured her; or the bride’s parents, having found
out about the groom that he is a drunkard, or diceplayer, or maimed,
or has done something bad, will not give him their daughter, and the
groom complains to the Patriarch,—the Patriarch institutes an
inquiry, and the fine is collected from the guilty party according to the
contract, and is given to the groom or bride, as the case may be; and
then both may marry whom they please.
But if both parties carry out their agreement, and get ready for the
wedding on the appointed day, then the groom invites to the wedding
his relatives and such other people as he likes, to be his ceremonial
guests, in the same manner as I described before about the Tsar’s
wedding[124]; on the part of the bride the guests are invited in the
same way. On the day of the wedding tables are set at the houses of
the groom and bride, and the word being given the groom that it is
time to fetch the bride, they all set out according to the ceremonial
rank: First the bread-men carry bread on a tray, then, if it be summer,
the priest with the cross rides on horseback, but in winter in a sleigh;
then follow the boyárs, the thousand-man, and the groom.
Having reached the court of the bride’s house, they enter the hall
in ceremonial order, and the bride’s father and his guests meet them
with due honour, and the order of the wedding is the same as
described in the Tsar’s wedding. When the time arrives to drive to
church to perform the marriage, the bride’smaids ask her parents to
give the groom and bride their blessing for the marriage. They bless
them with words, but before leaving bless them with a holy image,
and, taking their daughter’s hand, give her to the groom.
Then the ceremonial guests, the priest, and the groom with his
bride, whose hand he is holding, go out of the hall, and her parents
and their guests accompany them to the court; the groom places the
bride in a kolymága or kaptána, mounts a horse, or seats himself in
a sleigh; the ceremonial guests do likewise, and all drive to the
church where they are to be married. The bride’s parents and their
guests return to the hall, where they eat and drink until news is
brought from the groom; the bride is accompanied only by her own
and the bridegroom’s go-betweens. The two having been united, the
whole troop drives to the groom’s house, and news is sent to the
bride’s father that they have been propitiously married. When they
arrive at the groom’s court, the groom’s parents and their guests
meet them, and the parents, or those who are in their stead, bless
them with the images, and offer them bread and salt, and then all
seat themselves at the table and begin to eat, according to the
ceremony; and then the bride is unveiled.
The next morning the groom drives out with the bride’s-maid to call
the guests, those of his and the bride’s, to dinner. When he comes to
the bride’s parents, he thanks them for their having well brought up
their daughter, and for having given her to him in perfect health; after
having made the round to all the guests, he returns home. When all
the guests have arrived, the bride offers gifts to all the ceremonial
guests. Before dinner the groom goes with all the company to the
palace to make his obeisance to the Tsar. Having arrived in the
presence of the Tsar, all make a low obeisance, and the Tsar, without
taking off his cap, asks the married couple’s health. The groom bows
to the ground, and then the Tsar congratulates those who are united
in legitimate wedlock, and blesses the married pair with images, and
he presents them with forty sables, and for their garments a bolt of
velvet, and atlas, and gold-coloured silk, and calamanco, and simple
taffeta, and a silver vessel, a pound and a half to two pounds in
weight, to each of them; but the bride is not present at the audience.
Then the Tsar offers the thousand-man, and bridegroom, and the
ceremonial guests a cup of Rumney wine, and then a pitcher of
cherry wine, and after they have emptied their wine the Tsar
dismisses them.
After arriving home, they begin to eat and drink, and after the
dinner the parents and guests bless the married couple with images
and make them all kinds of presents, and after dinner the guests
drive home. On the third day, the bride and groom and the guests go
to dinner to the bride’s parents, with all their guests, and after the
dinner the bride’s parents and their guests make presents to the
married couple, and they drive home; and that is the end of the
festivity.
During the time that the groom is in the presence of the Tsar, the
bride sends in her name presents to the Tsarítsa and Tsarévnas,
tidies of taffeta, worked with gold and silver and pearls; the Tsarítsa
and Tsarévnas accept these gifts, and send to inquire about the
bride’s health.
During all the wedding festivities, no women are present, and
there is no music, except blowing of horns and beating of drums.
The proceeding is the same when a widowed daughter, or sister,
or niece is married off: the ceremonial and the festivity are the same.
In the beginning of the festivity, the priest who is to marry the pair
receives from the Patriarch and the authorities a permit, with the seal
attached to it, to marry them, having first ascertained that the bride
and groom are not related by sponsorship, nor by the ties of
consanguinity in the sixth and seventh generation, nor that he is the
husband of a fourth wife, nor she the wife of a fourth husband; but if
he discover that they are related by sponsorship, and so forth, he is
not allowed to marry them. Should the priest permit such an unlawful
marriage to take place, with his knowledge or without his knowledge,
he would be discharged from his priesthood and, if he was knowingly
guilty, he has to pay a big fine, and the authorities lock him up for a
year; but the married pair is divorced, without being fined, except the
sin which they have incurred, and if they have not been previously
married three times, they may marry again.
If a widower wants to marry a maiden, the ceremonial at the
wedding is the same, but during the wreathing in church the wreath
is placed on the groom’s right shoulder, whereas the bride wears her
wreath upon her head; if a widower for the third time marries a
maiden, the ceremonial is the same, but the wreath is placed on the
groom’s left shoulder, and the bride wears hers upon her head. The
same is done when a widow marries for the second or third time. But
when a widower marries for the second or third time a widow, then
there is no wreathing, and only a prayer is said instead of the
wreathing, and the wedding ceremonial is different from the one
mentioned above.
The manner of the parley, marriage and ceremonial wedding is the
same with the lower orders of the nobility as described above, and
the wedding is as sumptuous as they can afford to make it, but they
do not call upon the Tsar, except those of his retinue.
Among the merchants and peasants the parley and the ceremonial
are exactly the same, but they differ in their acts and dresses from
the nobility, each according to his means.
It sometimes happens that a father or mother has two or three
daughters, where the eldest daughter is maimed, being blind, or
lame, or deaf, or mute, while the other sisters are perfect in shape
and beauty and speech. When a man begins to sue for their
daughter, and he sends his mother, or sister, or someone else in
whom he has confidence to inspect her, the parents sometimes
substitute the second or third daughter for their maimed sister, giving
her the name of the latter, so that the inspectress, not knowing the
deceit, takes a liking to the girl and reports to the groom that she is a
proper person to marry. Then the groom, depending upon her words,
has a parley with the girl’s parents, that he is to marry her upon an
appointed day, and that the parents are to give her to him upon the
appointed day, and the fine is set so high that the guilty party is not
able to pay it. When the wedding takes place, the parents turn over
to him the maimed daughter, whose name is given in the articles of
marriage, but who is not the one the inspectresses had seen. But the
groom cannot discover on the wedding day that she is blind, or
disfigured, or has some other defect, or that she is deaf or mute, for
at the wedding she is veiled and does not say a word, nor can he
know whether she is lame, because her bride’smaids lead her under
her arms.
But in that case the man who has been deceived complains to the
Patriarch and authorities, and these take the articles of marriage and
institute an inquiry among the neighbours and housefolk, each one
individually, whether the person he had married is the one indicated
by name in the marriage articles. If so, the articles are valid, and no
faith is to be put in his contention, on the ground that it was his
business to be sure whom he was going to marry. But if the
neighbours and housefolk depose that the bride is not the same as
mentioned by name in the articles, the married pair is divorced, and
the parents have to pay a large fine and damages to the groom, and
besides the father is beaten with the knout, or his punishment is
even more severe, according to the Tsar’s will.
The same punishment is meted out to the man who presents his
serving maid or a widow in place of his unmarried daughter, by
giving her another name and dressing her up so as to look like his
daughter, or when his daughter is of short stature and they place her
on a high chair in such a way that her defect is not noticeable.
When parents have maimed or old daughters, and no one wants
to marry them, they are sent to a monastery to be shorn nuns.
When a man wants to inspect the bride himself, and the parents
grant the request, knowing that she is fair and that they need not be
ashamed of her, but the groom, having taken no liking to her, decries
her with damaging and injurious words, and thus keeps other suitors
away from her,—and the bride’s parents complain to the Patriarch or
authorities: these institute an inquiry, and having found the man
guilty, marry him to the girl by force; but if he has married another girl
before the complaint has been entered, the girl’s disgrace is taken
from her by an ukase.
When a man marries off his daughter or sister, and gives her a
large dowry in serfs and patrimony, and that daughter or sister,
having borne no children, or having borne some who have all died,
dies herself,—the dowry is all taken from her husband and is turned
over to those who had married her off. But if she leaves a son or
daughter, the dowry is, for the sake of her child, not taken from her
husband.
Gentle reader! Wonder not, it is nothing but the truth when I say
that nowhere in the whole world is there such deception practised
with marriageable girls as in the kingdom of Muscovy; there does not
exist there the custom, as in other countries, for the suitor to see and
sue for the bride himself.
The boyárs and Near People have in their houses 100, or 200, or
300, or 500, or 1000 servants, male and female, according to their
dignity and possessions. These servants receive a yearly salary, if
they are married, 2, 3, 5 or 10 roubles, according to their services,
and their wearing apparel, and a monthly allowance of bread and
victuals; they live in their own rooms in the court of the boyár’s
house. The best of these married servants are sent out by the
boyárs every year, by rotation, to their estates and villages, with the
order to collect from their peasants the taxes and rents. The
unmarried older servants receive some small wages, but the
younger ones receive nothing; all the unmarried servants get their
wearing apparel, hats, shirts and boots; the older of these servants
live in the farther lower apartments, and receive their food and drink
from the kitchen; on holidays they receive two cups of brandy each.
The female servants who are widows remain living in the houses of
their husbands, and they receive a yearly wage and a monthly
allowance of food; other widows and girls stay in the rooms of the
boyárs’ wives and daughters, and they receive their wearing apparel,
and their food from the boyár’s kitchen.
When these girls are grown up, the boyárs marry them, and also
the widows, to some one of their servants to whom they have taken
a liking, but sometimes by force. The wedding takes place in the
boyár’s hall, according to the rank of the marrying parties; the food
and festive dresses are furnished by the boyár. The girls are never
married to any person outside the boyár’s court, because both male
and female servants are his perpetual serfs. In the boyár’s house
there is an office for all domestic affairs, where an account is kept of
income and expenses, and all the affairs of the servants and
peasants are investigated and settled.
FOOTNOTES:

[121] A division of nobility below the boyárs.


[122] In the front corner, under the holy images.
[123] Bending as far as the girdle.
[124] “The wedding ceremony is as follows: on the Tsar’s side
the first order is the father and mother, or those who are in place
of his parents; the second order, the travellers,—the chief priest
with the cross, the thousand-man, who is a great personage in
that procession, and then the Tsar: eight boyárs. The duties of the
travellers are as follows: they stay with the Tsar and Tsarítsa at
the crowning in church, and at the table occupy higher places
than the others; the friends (drúzhka), whose duty it is to call the
guests to the wedding, to make speeches at the wedding in the
name of the thousand-man and Tsar, and to carry presents; the
bride’s maids (svákha) whose duty it is to watch the Tsarítsa, to
dress her and undress her; the candleholder, who holds the
candle when they get the Tsarítsa ready for the crowning; the
breadholders, who carry the bread on litters to and from church
(these litters are covered with gold velvet and embroidered cloth
and sable furs); the equerry with his suite. The third order is the
sitting boyárs, twelve men and twelve women, who sit as guests
at the tables, with the Tsar’s parents, but do not go to church with
the Tsar. The fourth order is of the court, who attend to the food
and drink.”

You might also like