Download as pdf or txt
Download as pdf or txt
You are on page 1of 44

New Perspectives on HTML 5 and CSS:

Comprehensive 8th Edition Patrick M.


Carey
Visit to download the full and correct content document:
https://ebookmass.com/product/new-perspectives-on-html-5-and-css-comprehensive-
8th-edition-patrick-m-carey/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

New Perspectives on HTML 5 and CSS 8th Edition Patrick


M. Carey

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

New Perspectives HTML5 and CSS3: Comprehensive 7th


Edition Patrick M. Carey

https://ebookmass.com/product/new-perspectives-html5-and-
css3-comprehensive-7th-edition-patrick-m-carey/

New Perspectives on HTML5, CSS3, and JavaScript 6th


Edition Patrick Carey

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

New Perspectives Microsoft Office 365 & Office 2019


Introductory 2019th Edition Patrick Carey

https://ebookmass.com/product/new-perspectives-microsoft-
office-365-office-2019-introductory-2019th-edition-patrick-carey/
New Perspectives on Computer Concepts 2018:
Comprehensive 20th Edition – Ebook PDF Version

https://ebookmass.com/product/new-perspectives-on-computer-
concepts-2018-comprehensive-20th-edition-ebook-pdf-version/

New Perspectives On The Internet: Comprehensive, Loose-


leaf Version 10th Edition Jessica Evans

https://ebookmass.com/product/new-perspectives-on-the-internet-
comprehensive-loose-leaf-version-10th-edition-jessica-evans/

HTML, CSS, and j■vascript All-in-One For Dummies 1st


Edition Paul Mcfedries

https://ebookmass.com/product/html-css-and-j%d0%b0vascript-all-
in-one-for-dummies-1st-edition-paul-mcfedries/

HTML, CSS, & JavaScript All-in-One For Dummies 1st


Edition Paul Mcfedries

https://ebookmass.com/product/html-css-javascript-all-in-one-for-
dummies-1st-edition-paul-mcfedries/

Comprehensive Gynecology 8th Edition David M Gershenson


Md

https://ebookmass.com/product/comprehensive-gynecology-8th-
edition-david-m-gershenson-md/
HTML 5 and
CSS

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


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

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

Notice to the Reader


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

Printed in the United States of America


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

“I love this text


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

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

iii
iv New Perspectives Series

“New Perspectives texts


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

PROSK ILL S ProSkills Boxes


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

K E Y S TEP Key Steps


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

INSIGHT InSight Boxes


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

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

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

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

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

Level Color Scheme

Our Complete System of Instruction


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

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

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

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

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

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

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

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

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

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

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

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

Level III Tutorials


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

Glossary REF 1

Index REF 11
viii New Perspectives Series

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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


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

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

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

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


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

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

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


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

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

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

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

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

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

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

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

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

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

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

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


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

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


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

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


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

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

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

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

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


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

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

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

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

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


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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

Appendix A Color Names with Color Values,


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

Appendix B HTML Elements and Attributes. . . HTML B1


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

STARTING DATA FILES

html01 tutorial review code1

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


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

code2 code3 code4

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

case1 case2 demo

jtc_index_txt.html dr_faq_txt.html demo_characters.html


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

Session 1.1 Visual Overview:


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

The <head> tag marks


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

The <body> tag marks


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

An opening tag marks


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

© Kzenon/Shutterstock.com;
A closing tag marks the © martiapunts/Shutterstock.com;
end of the element © Brian A Jackson/Shutterstock.com;
content; this tag marks the © sayhmog/Shutterstock.com;
end of the page footer. © rangizzz/Shutterstock.com
Another random document with
no related content on Scribd:
Saatuaan ne sileiksi hän taittoi ne kokoon, pisti taskuunsa ja lähti
Katerina Ivanovnan luo tekemään selkoa siitä, miten hänen oli
onnistunut suorittaa tämän antama tehtävä.

Viides kirja

Pro ja contra

1.

Kihlaus

Rouva Hohlakov oli taas ensimmäisenä Aljošaa


vastaanottamassa. Hänellä oli kiire. Oli sattunut tärkeä tapaus:
Katerina Ivanovnan hysteriakohtaus oli päättynyt pyörtymisellä,
sitten oli seurannut »kauhea, hirveä heikkous, hänen silmänsä
menivät vähän nurin ja hän alkoi hourailla. Nyt on kuumetta, on
lähetetty hakemaan Herzenstubea, on lähetetty hakemaan tätejä.
Tädit ovat jo täällä, mutta Herzenstube ei ole vielä tullut. Kaikki
istuvat hänen huoneessaan ja odottavat. Jotakin on tulossa, hän on
tajuton. Mitäs, jos tulee kuumetauti!»

Näin huudahtaessaan oli rouva Hohlakov vakavan ja pelästyneen


näköinen: »Tämä on jo vakavaa, tämä on vakavaa», lisäsi hän joka
sanan jälkeen, aivan kuin se, mitä Katerina Ivanovnalle aikaisemmin
oli tapahtunut, ei olisi ollut vakavaa. Aljoša kuunteli häntä
murheellisena: hän alkoi kertoa rouva Hohlakoville omia
seikkailujaan, mutta tämä keskeytti hänet heti alussa: hänellä ei ollut
aikaa, hän pyysi Aljošaa istumaan Lisen luona ja siellä odottamaan
häntä.

— Lise, rakas Aleksei Fjodorovitš, — kuiskasi hän Alešalle


melkein korvaan, — Lise hämmästytti minua ihmeellisesti äsken,
mutta sai myös liikutetuksi, ja sentähden sydämeni antaa hänelle
kaiken anteeksi. Ajatelkaahan, heti kun te olitte mennyt, hän alkoi
äkkiä vilpittömästi katua, että oli pitänyt muka teitä pilkkanaan eilen
ja tänään. Mutta eihän hän pilkannut, hän vain laski leikkiä. Nyt hän
katui niin vakavasti, melkein itkien, että minä hämmästyin. Hän ei ole
koskaan ennen vakavasti katunut, kun on pitänyt minua pilkkanaan,
vaan on aina lyönyt asian leikiksi. Ja tehän tiedätte, että hän pilkkaa
minua myötäänsä. Mutta nyt hän teki tuon vakavasti, nyt tapahtui
kaikki vakavasti. Hän pitää erittäin suuressa arvossa teidän
mielipidettänne, Aleksei Fjodorovitš, ja jos vain voitte, niin älkää
loukkaantuko häneen älkääkä olko vaativainen. Minä itse en muuta
teekään kuin hellin häntä, sillä hän on niin älykäs, — uskotteko sen?
Hän sanoi äsken, että te olette ollut hänen lapsuutensa ystävä,
»lapsuuteni totisin ystävä», — ajatelkaahan tätä, kaikkein totisin,
entä minä sitten? Hänellä on tässä suhteessa tavattoman vakavat
tunteet ja myös muistot ja, ennen kaikkea, nuo lausetavat ja sanat,
mitä yllättävimmät sanat, niin että ei osaa odottaakaan, kun ne jo
äkkiä tulevat suusta. Niinpä äsken hongasta esimerkiksi: meidän
puutarhassamme oli hänen varhaisimman lapsuutensa aikana
honka, saattaapa olla siellä vieläkin, niin ettei ole syytä puhua
menneessä ajassa. Hongat eivät ole ihmisiä, ne pysyvät pitkät ajat
muuttumattomina, Aleksei Fjodorovitš. »Äiti», sanoo hän, »minä
muistan tuon hongan kuin unessa», — tuo »hongan kuin unessa» —
hän sanoi sen jotenkuten toisin, minä sotken, honka on tyhmä sana,
mutta hän puhui minulle tämän johdosta jotakin niin omaperäistä,
että minä en mitenkään uskalla ryhtyä sitä selostamaan. Olen
sitäpaitsi unohtanut kaiken. No, näkemiin, minä olen hyvin järkytetty
ja tulen luultavasti hulluksi. Ah, Aleksei Fjodorovitš, kaksi kertaa
elämäni aikana olen ollut tulemaisillani hulluksi ja minua on hoideltu.
Menkää Lisen luo. Rohkaiskaa häntä, niinkuin te aina niin ihanasti
osaatte sen tehdä. — Lise, — huudahti hän astuen oven luo, — nyt
olen tuonut luoksesi Aleksei Fjodorovitšin, jota sinä olet niin suuresti
loukannut, eikä hän ole ensinkään vihainen, vakuutan sen sinulle,
päinvastoin hän ihmettelee, kuinka olet voinut sitä luulla!

— Merci, maman, tulkaa sisälle, Aleksei Fjodorovitš.

Aljoša astui sisään. Lise katseli häntä hieman hämillään ja sävähti


äkkiä punaiseksi. Hän nähtävästi häpesi jotakin ja, kuten tällöin on
tavallista, alkoi nopeasti puhua aivan muusta, aivan niinkuin tuo
kokonaan toinen asia sillä hetkellä olisikin kiinnittänyt hänen
mieltään.

— Äiti äsken yht'äkkiä kertoi minulle, Aleksei Fjodorovitš, koko


jutun noista kahdestasadasta ruplasta ja tuosta teille annetusta
tehtävästä… tuon köyhän upseerin luona… ja kertoi minulle koko
tuon kauhean tapauksen, miten häntä loukattiin, ja, tiedättekö,
vaikka äiti kertoo hyvin sotkuisesti… hän hyppää aina asiasta
toiseen… niin minä itkin kuunnellessani. No, kuinka kävi, annoitteko
te nuo rahat ja miten on nyt tuon onnettoman laita?…

— Siinäpä se onkin, että en antanut, ja tässä on pitkä historia, —


vastasi Aljoša näyttäen puolestaan olevan enimmän huolestunut
siitä, että ei ollut saanut annetuksi rahoja, vaikka Lise varsin hyvin
huomasi hänenkin katselevan sivulle ja niinikään nähtävästi
koettavan puhua muusta, kuin mitä oli mielessä. Aljoša istuutui
pöydän luo ja alkoi kertoa, mutta jo ensimmäisistä sanoista alkaen
hän lakkasi olemasta hämillään ja tempasi puolestaan Lisen
mukaansa. Hän puhui voimakkaan tunteen vaikutuksen ja äskeisen
tavallisuudesta poikkeavan vaikutelman alaisena ja hänen onnistui
kertoa hyvin ja seikkaperäisesti. Hänellä oli ennenkin ollut tapana, jo
Moskovassa Lisen ollessa lapsena, tulla hänen luokseen ja kertoa
semmoista, mitä hänelle juuri oli tapahtunut tai mitä hän oli lukenut,
tai muistella lapsuusaikansa kokemuksia. Toisinaan he molemmat
haaveilivat yhdessä ja sepittelivät kahden kesken kokonaisia
tarinoita, enimmäkseen iloisia ja naurattavia. Nyt he molemmat
ikäänkuin siirtyivät äkkiä entisiin Moskovan aikoihin, kaksi vuotta
taaksepäin. Liseä järkytti tavattomasti Aljošan kertomus. Aljoša osasi
lämpimästi kuvata hänelle »Iljušetškan» koko olemuksen. Kun hän
oli yksityiskohtaisesti kuvannut, mitenkä onneton mies polki rahat
jalkojensa alle, niin Lise löi kätensä yhteen ja huusi voimatta hillitä
tunteitaan:

— Te ette siis antanut rahoja, te annoitte hänen juosta pois tuolla


tavoin! Herra Jumala, olisitte edes itse juossut hänen jälkeensä ja
tavoittanut hänet…

— Ei, Lise, näin on parempi, että minä en juossut, — sanoi Aljoša,


nousi tuolilta ja käveli huolestuneena huoneessa.

— Miksi parempi, missä suhteessa parempi? Nyt he ovat ilman


leipää ja ovat hukassa!

— Eivät ole hukassa, sillä nämä kaksisataa ruplaa joutuvat


kuitenkin heille. Hän ottaa ne kuitenkin huomenna. Huomenna hän
aivan varmasti ottaa ne, — lausui Aljoša astellen mietteissään. —
Näettekö, Lise, — jatkoi hän pysähtyen äkkiä hänen eteensä, —
minä itse tein tässä virheen, mutta virhekin koitui hyväksi.
— Mikä virhe se oli ja minkä tähden se koitui hyväksi?

— Asia on tämmöinen: hän on pelkurimainen ja heikkoluonteinen


mies. Hän on läpikiusattu ja perin hyväsydäminen. Nyt ajattelen näin:
mistä hän yht'äkkiä noin loukkaantui ja miksi polki rahat jalkoihinsa,
sillä, vakuutan sen teille, hän ei viimeiseen hetkeen saakka tietänyt,
että polkisi ne jalkoihinsa. Ja minusta näyttää, että hän loukkaantui
tässä monestakin syystä… eikä muuten voinut ollakaan hänen
asemassaan… Ensiksikin hän suuttui jo siitä, että oli minun nähteni
liiaksi ilostunut rahoista eikä ollut salannut sitä minulta. Jos hän olisi
ilostunut, mutta ei kovin paljon eikä olisi sitä näyttänyt, vaan
kursaillut kuten toiset rahoja ottaessaan sekä teeskennellyt, no,
silloin kaikki olisi vielä ollut siedettävää ja hän olisi voinut ottaa
vastaan, mutta nyt hän ilostui liian vilpittömästi, ja se juuri on
alentavaa. Ah, Lise, hän on vilpitön ja hyväsydäminen mies, sepä
juuri onkin onnetonta tämmöisissä tapauksissa! Kaiken aikaa, kun
hän silloin puhui, oli hänen äänensä niin heikko, heikontunut, ja hän
puhui hyvin kiireesti ja ikäänkuin nauraa hihitti tai itki… toden totta,
hän itki, niin ihastuksissaan hän oli… ja hän puhui tyttäristään… ja
paikasta, jonka hän saa toisessa kaupungissa… Mutta heti kun hän
oli purkanut sydämensä, niin häntä alkoi yht'äkkiä hävettää, että hän
tuolla tavoin oli paljastanut minulle koko sydämensä. Ja niinpä hän
samassa alkoi vihata minua. Hän on noita hirveän häveliäitä köyhiä.
Mutta etupäässä hän suuttui siitä, että oli liian pian ottanut minut
ystäväkseen ja niin pian minulle antautunut. Hän oli hyökkäillyt
kimppuuni, peloitellut, mutta heti rahat nähtyään alkanut minua
syleillä. Hän näet syleili minua, nyki minua kaiken aikaa käsillään.
Juuri näin hänen täytyi tuntea koko tuo alennuksensa, ja tässä juuri
minä tein tuon virheeni, sangen pahan virheen: minä sanoa tokaisin
hänelle, että jos hänen rahansa eivät riitä toiseen kaupunkiin
muuttamiseen, niin hän saa vielä lisää ja minä itsekin annan hänelle
omista rahoistani niin paljon kuin hän haluaa. Tämäpä juuri häntä
yht'äkkiä hämmästytti: miksi minäkin olin tuppautunut häntä
auttamaan? Tiedättekö, Lise, on suorastaan hirveätä, miten raskasta
loukatulle ihmiselle on, kun kaikki alkavat suhtautua häneen hänen
hyväntekijöinään… minä olen kuullut siitä, luostarinvanhin on minulle
siitä puhunut. Minä en tiedä, miten sen sanoisin, mutta olen sen
usein itsekin nähnyt. Ja aivan sama tunnehan minulla on itsellänikin.
Mutta pääasia on, että vaikka hän ei tietänytkään viimeiseen
silmänräpäykseen asti, että hän polkee setelit jalkojensa alle, niin
hän kuitenkin aavisti sen, se on aivan varmaa. Juuri siksi hänen
riemastuksensakin oli niin voimakas, kun hän aavisti… Ja vaikka
tämä kaikki kävi niin huonosti, niin se kuitenkin koitui hyväksi.
Luulenpa todella, että kerrassaan parhaaksi, sen paremmin ei olisi
voinut käydäkään…

— Miksi, miksi ei sen paremmin olisi voinut käydäkään? —


huudahti Lise katsellen hyvin ihmeissään Aljošaa.

— Siksi, Lise, että jos hän ei olisi näitä rahoja polkenut jalkoihinsa,
vaan ottanut ne, niin hän kotiin tultuaan ehkä jo tunnin kuluttua olisi
alkanut itkeä omaa alennustaan, — niin olisi ehdottomasti käynyt.
Hän olisi itkenyt ja kenties huomenna heti päivän koittaessa tullut
luokseni ja kenties paiskannut minulle setelit ja polkenut ne
jalkojensa alle kuten äsken. Mutta nyt hän poistui hirveän ylpeänä ja
voitonriemuisena, vaikka tietääkin, että »syöksi itsensä turmioon».
Nyt siis ei mikään ole helpompaa kuin saada hänet ottamaan
vastaan nämä kaksisataa ruplaa jo huomenna, sillä hän on jo
osoittanut olevansa kunnian mies, hän on paiskannut rahat
menemään, polkenut niitä jaloillaan… Eihän hän voinut niitä
polkiessaan tietää, että minä tuon ne hänelle taas huomenna.
Toiselta puolen taas nämä rahat ovat hänelle hirveän tarpeelliset.
Vaikka hän nyt onkin ylpeä, niin kuitenkin hän tänäänkin ajattelee,
millaisen avun hän on menettänyt. Yöllä hän ajattelee sitä vielä
enemmän, näkee sen unissaan, ja huomisaamuna hän kenties on jo
valmis juoksemaan luokseni ja pyytämään anteeksi. Mutta silloinpa
juuri minä saavunkin: »Niin, te olette ylpeä mies, te olette sen
osoittanut, no niin, ottakaa nyt vastaan, antakaa meille anteeksi.»
Silloin hän ottaa!

Aljoša lausui jonkinmoisen hurmion vallassa: »silloin hän ottaa!»


Lise taputti käsiään.

— Ah, se on totta, ah, ymmärsin sen nyt yht'äkkiä hirveän hyvin!


Ah, Aljoša, kuinka te kaiken tuon tiedätte? Niin nuori ja tietää jo, mitä
on sydämessä… Minä en olisi koskaan keksinyt tuota…

— Pääasia on nyt saada hänet vakuutetuksi siitä, että hän on


meidän kaikkien vertainen, siitä huolimatta, että hän ottaa meiltä
vastaan rahaa, — jatkoi Aljoša edelleen hurmaantuneena, — eikä
vain meidän vertaisemme, vaan meidän yläpuolellamme…

— »Meidän yläpuolellammekin» — oivallista, Aleksei Fjodorovitš,


mutta puhukaa, puhukaa!

— No niin, minä käytin väärää sanaa… tuosta yläpuolella


olemisesta… mutta ei se tee mitään, sillä…

— Ah, ei mitään, ei mitään, ei tietystikään mitään! Antakaa


anteeksi, Aljoša rakas… Tiedättekö, minä en tähän saakka ole teitä
juuri ollenkaan kunnioittanut… toisin sanoen, olen kunnioittanut,
mutta vain vertaisenani, mutta nyt kunnioitan etevämpänä…
Rakkaani, älkää olko vihainen, että minä »veistelen», — jatkoi hän
heti taas hyvin tunteikkaasti. — Minä olen naurettava ja
vähäpätöinen, mutta te, te, kuulkaa, Aleksei Fjodorovitš, eikö tässä
kaikessa meidän ajattelussamme, nimittäin teidän… ei, parempi on
sanoa meidän… eikö tässä ole halveksimista häntä kohtaan, tuota
onnetonta kohtaan… siinä, että me nyt analysoimme näin hänen
sieluaan aivan kuin ylempää, vai mitä? Siinä nimittäin, että päätimme
nyt niin varmasti hänen ottavan vastaan rahat, mitä?

— Ei, Lise, ei se ole halveksimista, — vastasi Aljoša lujasti, aivan


kuin olisi jo valmistautunut tähän kysymykseen vastaamaan, —
ajattelin tätä jo itse tänne tullessani. Ajatelkaahan, mitä
halveksimista siinä olisi, kun me itse olemme samanlaisia kuin hän,
kun kaikki ovat samanlaisia kuin hän. Sillä samanlaisiahan me
olemme emmekä parempia. Ja jos olisimmekin parempia, niin
olisimme kuitenkin samanlaisia hänen sijassaan… Minä en tiedä,
miten te, Lise, mutta itse olen itsestäni sitä mieltä, että minulla on
monessa suhteessa pieni sielu. Mutta hänellä se ei ole pieni, vaan
päinvastoin sangen miellyttävä… Ei, Lise, ei tässä ole mitään
halveksimista häntä kohtaan! Tiedättekö, Lise, minun
luostarinvanhimpani sanoi kerran: ihmisiä täytyy alati hoitaa kuin
lapsia ja toisia heistä kuin sairaita sairashuoneessa…

— Ah, Aleksei Fjodorovitš, ah, ystäväni, hoidelkaamme ihmisiä


niinkuin sairaita!

— Hoidelkaamme, Lise, olen valmis siihen, minä vain en itse ole


täysin valmis, olen toisinaan hyvin kärsimätön ja toisinaan en
ymmärrä mitään. Toisin on teidän laitanne.

— Ah, en usko! Aleksei Fjodorovitš, miten onnellinen olenkaan!

— Kuinka hauskaa, että puhutte noin, Lise.


— Aleksei Fjodorovitš, te olette ihmeteltävän hyvä, mutta toisinaan
te tunnutte pedantilta… mutta lähemmin katsoen ette ole ollenkaan
pedantti. Menkää, katsokaa ovelta, avatkaa ovi hiljaa ja katsokaa,
eikö äiti ole kuuntelemassa, — kuiskasi Lise äkkiä hermostuneesti ja
kiireesti.

Aljoša meni, avasi oven ja ilmoitti, ettei kukaan ollut salaa


kuuntelemassa.

— Tulkaa tänne lähemmäksi, Aleksei Fjodorovitš, — jatkoi Lise


yhä enemmän punastuen, — antakaa kätenne, kas noin. Kuulkaa,
minun täytyy tehdä teille suuri tunnustus: eilistä kirjettä minä en
kirjoittanut teille piloillani, vaan tosissani…

Ja hän peitti kädellään silmänsä. Näkyi, että häntä suuresti hävetti


tämä tunnustus. Äkkiä hän tarttui Aljošan käteen ja suuteli sitä
nopeasti kolme kertaa.

— Ah, Lise, tämä on hyvin, — huudahti Aljoša iloisesti. —


Minähän olin täysin vakuutettu siitä, että te kirjoititte tosissanne.

— Vakuutettu, ajatelkaahan! — hän vei äkkiä edemmäksi Aljošan


käden päästämättä sitä kuitenkaan kädestään, punastui hirveästi ja
nauroi pientä, onnellista naurua. — Minä suutelin hänen kättään, ja
hän sanoo: »Se on hyvin.»

Mutta hän soimasi syyttä Aljošaa: tämä oli myös pahasti


hämmentynyt.

— Minä tahtoisin aina miellyttää teitä, Lise, mutta en tiedä, kuinka


sen tekisin, — sai hän jotenkuten mutisseeksi ja punastui niinikään.
— Aljoša rakas, te olette kylmä ja julkea. Näettekö. Hän on
suvainnut valita minut puolisokseen ja nyt hän on varsin tyyni! Hän
oli jo vakuutettu siitä, että minä kirjoitin tosissani, mitäs siitä on
arveltava! Sehän on julkeata — sitä se on!

— Oliko se sitten paha, että minä olin vakuutettu? — alkoi Aljoša


äkkiä nauraa.

— Ah, Aljoša, päinvastoin hirveän hyvä, — sanoi Lise katsoen


häneen hellästi ja onnellisena. Aljoša seisoi yhä pitäen kättään
hänen kädessään. Äkkiä hän kumartui ja suuteli hänen huuliaan.

— Mitä tämä vielä oli? Mikä teidän on? — huudahti Lise. Aljoša
joutui aivan ymmälle.

— No, antakaa anteeksi, jos se ei ollut paikallaan… Minä kenties


tein hirveän typerästi… Te sanoitte minua kylmäksi, minä otin ja
suutelin… Mutta näen tehneeni tyhmästi…

Lise alkoi nauraa ja peitti kasvonsa käsiinsä.

— Ja tuossa puvussa! — pääsi hänen suustaan kesken naurun,


mutta äkkiä hän lakkasi nauramasta ja tuli aivan vakavan, melkeinpä
ankaran näköiseksi.

— No, Aljoša, me jätämme vielä suutelemiset sikseen, sillä emme


osaa sitä vielä kumpikaan ja meidän on vielä odotettava hyvin
kauan, — päätti hän äkkiä. — Sanokaa mieluummin, miksi te otatte
minut, tämmöisen hupsun, sairaan hupsuttelijan, te, joka olette niin
viisas, niin ajatteleva, niin huomaava? Ah, Aljoša, minä olen hirveän
onnellinen, sillä en ole ollenkaan teidän arvoisenne!
— Olette hyvinkin, Lise. Minä lähden näinä päivinä luostarista
kokonaan pois. Kun tulen maailmaan, niin minun pitää mennä
naimisiin, sen tiedän. Näin on hän minua käskenyt. Kenet teitä
paremman ottaisin… ja kuka muu kuin te ottaisi minut? Olen sitä jo
harkinnut. Ensiksikin te tunnette minut lapsesta asti, ja toiseksi teillä
on sangen paljon hyviä ominaisuuksia, joita minulla ei ollenkaan ole.
Teillä on iloisempi mieli kuin minulla. Tärkeintä on, että te olette
viattomampi kuin minä, joka olen jo saanut nähdä monenlaista,
monenlaista… Ah, te ette tiedä, olenhan minäkin Karamazov! Mitä
siihen tulee, että te nauratte ja teette pilaa myöskin minusta, niin
päinvastoin naurakaa vain. Minä olen siitä hyvin iloinen. Te nauratte
kuin pieni tyttö, mutta teidän ajatuksenne ovat kuin marttyyrin…

— Kuin marttyyrin? Kuinka niin?

— Niin, Lise, tuo äskeinen kysymyksenne, eikö meissä ole


halveksimista tuota onnetonta kohtaan, kun me noin anatomin tavoin
repostelemme hänen sieluaan, — tuo kysymys on marttyyrin
kysymys… nähkääs, minä en mitenkään osaa sitä sanoa sanoilla,
mutta se, jonka mieleen nousee tuollaisia kysymyksiä, se kykenee
itse kärsimään. Lepotuolissa istuessanne te nytkin jo varmasti olette
paljon ajatellut…

— Aljoša, antakaa minulle kätenne, miksi te otatte sen pois, —


lausui Lise onnesta heikontuneella, ikäänkuin sortuneella äänellä. —
Kuulkaa, Aljoša, mihin te pukeudutte, kun lähdette pois luostarista,
millaiseen pukuun? Älkää naurako, älkää suuttuko, se on minusta
hyvin, hyvin tärkeätä.

— Pukua, Lise, en ole vielä ajatellut, mutta minä pukeudun


sellaiseen kuin te tahdotte.
— Minä tahdon, että teillä olisi tummansininen samettitakki,
valkoinen pikeeliivi ja harmaa, pehmoinen majavaishattu… Sanokaa,
uskoitteko tosiaan äsken, että minä en rakasta teitä, kun kielsin
eilisen kirjeeni?

— Ei, en uskonut.

— Oi, sietämätön mies, parantumaton!

— Näettekö, minä tiesin, että te minua… luultavasti rakastatte,


mutta minä olin uskovinani teitä, jotta teille olisi… mukavampi…

— Vielä sitäkin pahempi! Pahinta ja parasta kaikesta. Aljoša, minä


rakastan teitä hirveästi. Äsken, kun teidän oli määrä tulla, minä
päätin povata tällä tavoin: pyydän häneltä eilistä kirjettä, ja jos hän
rauhallisesti ottaa sen esille ja antaa minulle (kuten häneltä aina
kyllä voi odottaa), niin silloin on selvää, että hän ei ollenkaan rakasta
minua, hänellä ei ole mitään tunteita minua kohtaan, hän on vain
tyhmä ja arvoton poika ja minun elämäni on mennyttä. Mutta te jätitte
kirjeen luostarikammioon ja se rohkaisi minua: eikö totta, te jätitte
sen kammioon siksi, että aavistitte minun vaativan kirjettäni takaisin
ettekä te halunnut sitä antaa? Eikö niin? Niinhän?

— Oh, Lise, ei se ole ollenkaan niin, kirjehän on mukanani nytkin


ja oli äskenkin, täällä taskussa, kas tuossa se on.

Aljoša otti nauraen taskustaan kirjeen ja näytti sitä hänelle kaukaa.

— Mutta minä en anna sitä teille, katsokaa, minun käsistäni.

— Kuinka? Te siis äsken valehtelitte, olette munkki ja valehtelitte?


— Taisinpa valehdella, — nauroi Aleša, — valehtelin, ettei tarvitsisi
antaa teille kirjettä. Se on minulle hyvin kallis, — lisäsi hän äkkiä
hyvin tunteikkaasti ja punastui taas. — Niin on elämäni loppuun asti,
enkä minä anna sitä koskaan kenellekään!

Lise katsoi häneen ihastuneena.

— Aljoša, — lepersi hän taas, — katsokaa ovelta, eikö äiti ole


salaa kuuntelemassa.

— Hyvä on, Lise, minä katson, mutta eikö olisi parempi olla
katsomatta, vai mitä? Miksi epäilisimme äitiänne semmoisesta
alhaisesta menettelystä?

— Alhaisesta menettelystä? Kuinka niin? Se, että hän salaa


kuuntelee tyttärensä puheita, on hänen oikeutensa eikä mikään
alhainen teko, — kivahti Lise. — Olkaa varma siitä, Aleksei
Fjodorovitš, että kun minusta itsestäni tulee äiti ja minulla on
samanlainen tytär kuin minä, niin minä ehdottomasti kuuntelen salaa
hänen puheitaan.

— Niinkö tosiaankin, Lise Se ei ole hyvä.

— Ah, Herra Jumala, mikä siinä olisi alhaista? Jos olisi jokin
tavallinen keskustelu seuraelämässä ja minä asettuisin sitä salaa
kuuntelemaan, niin se olisi alhainen teko, mutta tässähän on oma
tytär kahden kesken eri huoneessa nuoren miehen kanssa…
Kuulkaa, Aljoša, tietäkää, että minä rupean pitämään silmällä myös
teitä heti, kun meidät on vihitty, ja tietäkää sekin, että minä avaan ja
luen kaikki teidän kirjeenne… Tämän te siis tiedätte nyt etukäteen…
— Niin, tietysti, jos kerran… — mutisi Aljoša, mutta se ei ole
hyvä…

— Ah, millaista halveksumista! Aljoša rakas, älkäämme riidelkö jo


ensimmäisestä kerrasta lähtien, — sanon teille mieluummin koko
totuuden: on tietysti hyvin paha kuunnella salaa, minä olen väärässä
ja te olette oikeassa, mutta kyllä minä kuuntelen joka tapauksessa.

— Tehkää niin. Ette te saa minua mistään kiinni, — nauroi Aljoša.

— Aljoša, mutta alistutteko te minun tahtooni? Se pitää myös


etukäteen ratkaista.

— Suurella halulla, Lise, ja ehdottomasti, mutta en kaikkein


tärkeimmissä. Jos te kaikkein tärkeimmässä asiassa olette toista
mieltä kuin minä, niin minä kuitenkin teen, niinkuin velvollisuuteni
vaatii.

— Niin pitääkin. Tietäkää siis, että minäkin olen valmis alistumaan


en vain kaikkein tärkeimmässä, vaan päinvastoin kaikessa annan
perään teille ja vannon sen teille nyt, — kaikessa ja koko elämäni
ajan, — huudahti Lise innostuksesta liekehtien, — ja se on onneksi,
onneksi! Vielä enemmänkin, vannon teille, että minä en milloinkaan
kuuntele salaa teitä, en kertaakaan enkä koskaan, en lue
ainoatakaan kirjettänne, sentähden että te olette oikeassa, mutta
minä en ole. Ja vaikka mieleni hirmuisesti tekee kuunnella salaa,
minä tiedän sen, niin en kuitenkaan sitä tee, sentähden että se
teidän mielestänne ei ole oikein. Te olette nyt niinkuin minun
Kaitselmukseni… Kuulkaa, Aleksei Fjodorovitš, miksi te kaikkina
näinä päivinä olette ollut niin surullinen, sekä eilen että tänään. Minä
tiedän, että teillä on huolia, ikäviä asioita, mutta minä näen, että teillä
sitäpaitsi on jokin erityinen suru, — kenties se on salaisuus, vai
mitä?
— Niin, Lise, on salainenkin suru, — lausui Aljoša surullisesti. —
Näen, että te rakastatte minua, koska arvasitte sen.

— Mikä suru se on? Mitä se koskee? Voiko sen sanoa? — lausui


Lise aran rukoilevasti.

— Minä sanon sen myöhemmin, Lise… myöhemmin… — sanoi


Aljoša hämillään. — Nyt sitä kenties olisi mahdoton ymmärtääkin.
Ehkäpä en itsekään osaisi sitä sanoa.

— Minä tiedän sitäpaitsi, että teitä kiusaavat veljenne, ja isä


myös?

— Niin, veljetkin, — lausui Aljoša ikäänkuin mietteissään.

— Minä en pidä teidän veljestänne Ivan Fjodorovitšista, Aljoša, —


huomautti äkkiä Lise.

Aljoša pani merkille tämän huomautuksen hieman ihmetellen,


mutta ei ymmärtänyt sitä.

— Veljeni syöksyvät turmioon, — jatkoi hän, — ja isäni myös. Ja


toisia he saattavat turmioon samalla kertaa kuin itsensä. Siinä toimii
»Karamazovien maallinen voima», niinkuin isä Paísi äskettäin lausui,
— maallinen ja vimmattu, viimeistelemätön… Liikkuuko ollenkaan
Jumalan Henki tämän voiman yläpuolella — sitäkään minä en tiedä.
Tiedän vain, että minä itsekin olen Karamazov… Olen munkki,
munkki? Olenko minä munkki, Lise? Tulitte äsken juuri jotenkin
sanoneeksi, että minä olen munkki?

— Niin sanoin.
— Mutta minäpä kenties en usko Jumalaankaan.

— Ette usko, mikä teidän on? — lausui Lise hiljaa ja varovasti.


Mutta Aljoša ei vastannut tähän. Noissa hänen liian äkkiä
lausumissaan sanoissa oli jotakin liian salaperäistä ja liian
subjektiivista, kenties hänelle itselleenkin epäselvää, mutta
semmoista, mikä ehdottomasti kiusasi häntä.

— Ja kaiken lisäksi tekee nyt lähtöä minun ystäväni, maailman


paras mies, jättää maallisen vaelluksen. Jospa te tietäisitte, jospa te
tietäisitte, Lise, millä siteillä minä olen kiintynyt, miten minä olen
henkisesti kiintynyt tähän mieheen! Ja nyt minä jään yksin… Minä
tulen teidän luoksenne, Lise… Vastedes olemme yhdessä…

— Niin, yhdessä, yhdessä! Tästä lähin aina yhdessä koko elämän


ajan.
Kuulkaa, suudelkaa minua, minä sallin sen.

Aljoša suuteli häntä.

— No, menkää nyt Kristuksen nimeen! (ja hän siunasi Aljošaa


ristinmerkillä). Menkää pian hänen luokseen, kun hän vielä on
elossa. Minä huomaan julmalla tavalla viivyttäneeni teitä. Minä
rukoilen tänään hänen puolestaan ja teidän puolestanne.
Tulemmehan onnellisiksi, tulemmehan?

— Luullakseni tulemme, Lise.

Lähtiessään Lisen luota Aljoša katsoi parhaaksi olla menemättä


rouva Hohlakovin luo ja lähti menemään pois talosta sanomatta
hänelle jäähyväisiä. Mutta juuri kun hän oli avannut oven ja tullut
ulos portaille, niin jostakin ilmestyi hänen eteensä itse rouva
Hohlakov. Ensimmäisistä sanoista Aljoša arvasi, että hän oli
odottanut häntä siinä tahallaan.

— Aleksei Fjodorovitš, se on kauheata. Se on lapsellista,


jonninjoutavaa ja pelkkää hölynpölyä. Toivon, että te ette rupea
haaveilemaan… Tyhmyyksiä, tyhmyyksiä, pelkkiä tyhmyyksiä! —
syöksähti hän puhumaan.

— Älkää vain puhuko tätä hänelle, — sanoi Aljoša, — muuten hän


kiihtyy, ja se on hänelle nyt vahingollista.

— Kuulen järkevän sanan järkevän nuorukaisen suusta. Onko


minun ymmärrettävä asia niin, että te itse vain sen tähden taivuitte
hänen tuumiinsa, että huomioonottaen hänen sairaalloisen tilansa
ette tahtonut suututtaa häntä vastaanpanemisella?

— Oi, ei, ei ensinkään, minä puhuin hänen kanssaan aivan


vakavasti, — ilmoitti Aljoša lujasti.

— Vakavuus ei tässä ole mahdollinen eikä ajateltavissa, ja


ensiksikään minä en tämän jälkeen ota teitä ollenkaan vastaan
ainoatakaan kertaa, toiseksi minä matkustan pois ja vien hänet
mennessäni, tietäkää se.

— Miksi niin, — sanoi Aljoša, — sehän on vielä niin kaukana


tulevaisuudessa, pitää odottaa kenties puolitoista vuotta.

— Ah, Aleksei Fjodorovitš, se on kylläkin totta, ja puolessatoista


vuodessa te riitaannutte hänen kanssaan tuhat kertaa ja eroatte.
Mutta minä olen niin onneton! Olkoonpa tämä vain kaikki
jonninjoutavaa, minut se on kuitenkin masentanut. Minä olen nyt
niinkuin Famusov viimeisessä näytöksessä, te olette Tšatskij, hän on
Sofia, ja, ajatelkaahan, minä juoksin vartavasten ulos tänne portaille
kohdatakseni teidät, ja siellähän kaikki kovan kohtalon sallima
tapahtui niinikään portailla. Minä kuulin kaikki, töin tuskin jaksoin
seisoa paikallani. Tässä on siis selitys kaikkiin viime yön kauhuihin ja
kaikkiin äskeisiin hysteriakohtauksiin! Tyttärelle lempi, mutta äidille
kuolema. Mene hautaan. Nyt toinen ja tärkein asia: mikä kirje se on,
jonka hän teille on kirjoittanut, näyttäkää minulle se heti, heti!

— Ei, ei ole tarpeen. Sanokaa, miten Katerina Ivanovna voi, minun


on hyvin tärkeätä saada tietää se.

— Makaa edelleen houraillen, ei ole tullut tajuihinsa. Hänen tätinsä


täällä vain voihkivat ja rehentelevät minulle, ja Herzenstube tuli ja
pelästyi niin, että minä en tietänyt, mitä hänelle olisi tehtävä ja miten
hänet saisi rauhoittumaan, aioin jo toimittaa hänelle lääkärin.
Herzenstube vietiin pois minun vaunuissani. Ja äkkiä kaiken lisäksi
olette te täällä tuon kirjeen kanssa. Totta on, että kaikki tämä on vielä
puolentoista vuoden takana. Kaiken suuren ja pyhän nimessä,
kuolevan luostarinvanhimpanne nimessä, näyttäkää minulle se kirje,
Aleksei Fjodorovitš, minulle, äidille! Jos tahdotte, niin pitäkää sitä
kiinni sormillanne, minä luen sen teidän käsistänne.

— Ei, en minä näytä, Katerina Osipovna, vaikka hän sallisikin, niin


minä en näytä. Minä tulen huomenna, ja jos tahdotte, puhun
kanssanne monesta asiasta, mutta nyt — hyvästi!

Ja Aljoša juoksi portailta kadulle.

2.
Smerdjakov kitaran kera

Eikä hänellä ollut aikaakaan. Hänen päässään oli välähtänyt eräs


ajatus jo silloin, kun hän sanoi jäähyväiset Liselle. Tämä ajatus:
kuinka voisi kaikkein ovelimmin saada nyt kiinni veli Dmitrin, joka
ilmeisesti piileksi häntä? Ei ollut enää aikaista, oli kolmas tunti
iltapäivää. Koko olemuksellaan Aljoša halusi luostariin »suuren»
kuolevan luo, mutta välttämättömämpää kuin mikään muu oli tavata
veli Dmitri: Aljošan mielessä vahvistui joka hetki yhä enemmän se
varmuus, että välttämätön ja kauhea katastrofi oli tulossa. Mikä tuo
katastrofi oli ja mitä hän tällä hetkellä tahtoi sanoa veljelleen, sitä
hän kenties ei itsekään olisi osannut määritellä. »Kuolkoon
hyväntekijäni poissaollessani, ainakaan minä en sitten soimaa
itseäni alati koko elämäni ajan siitä, että kenties olisin voinut
pelastaa enkä pelastanut, vaan kuljin ohi, kiiruhdin kotiini. Jos nyt
teen näin, niin menettelen hänen suuren sanansa mukaisesti.»

Hänen suunnitelmanaan oli saada veli Dmitri käsiinsä sattuman


kaupalla, nimittäin kiivetä kuten eilenkin tuon säleaidan yli, mennä
puutarhaan ja istuutua tuohon huvimajaan. »Jos taas hän ei ole
siellä», ajatteli Aleša, »niin sanomatta mitään Tuomaalle ja
emännälle oli piilouduttava huvimajaan ja odotettava siellä vaikkapa
iltaan asti. Jos hän kuten ennenkin vahtii Grušenjkan tuloa, niin on
hyvin mahdollista, että hän tulee huvimajaan»… Aljoša muuten ei
ruvennut kovin paljon miettimään suunnitelman yksityiskohtia, mutta
hän päätti panna sen toimeen, vaikka sitten ei ennättäisikään
luostariin tänään…

Kaikki sujui vastuksitta: hän kiipesi säleaidan yli melkein samasta


kohdasta kuin eilen ja pääsi kenenkään näkemättä hiipimään
huvimajaan. Hän ei tahtonut, että hänet huomattaisiin: sekä emäntä

You might also like