Professional Documents
Culture Documents
Textbook New Perspectives Html5 and Css3 Comprehensive 7Th Edition Patrick M Carey Ebook All Chapter PDF
Textbook New Perspectives Html5 and Css3 Comprehensive 7Th Edition Patrick M Carey Ebook All Chapter PDF
https://textbookfull.com/product/new-perspectives-on-
html5-css3-and-javascript-6th-edition-patric-carey/
https://textbookfull.com/product/new-perspectives-on-html-5-and-
css-comprehensive-8th-edition-patrick-m-carey/
https://textbookfull.com/product/new-perspectives-on-html-5-and-
css-8th-edition-patrick-m-carey/
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/
https://textbookfull.com/product/new-perspectives-microsoft-
windows-10-comprehensive-lisa-ruffolo/
https://textbookfull.com/product/beginning-iphone-and-ipad-web-
apps-scripting-with-html5-css3-and-javascript-1st-edition-apers-
chris-paterson-daniel/
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.
Comprehensive
Patrick Carey
Cengage Learning
20 Channel Center Street
Boston, MA 02210
USA
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.
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
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.
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
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
glossary ref 1
index ref 11
HTML5 and CSS3, 7th Edition, Comprehensive ix
TaBLE oF ConTEnTS
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii sessioN 1.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 22
Viewing an HTML File in a Browser . . . . . . . . . . . HTML 12 Turning an Inline Image into a Link . . . . . . . . . . . HTML 59
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
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
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
Vertical Centering . . . . . . . . . . . . . . . . . . . . . . . HTML 182 Session 3.3 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 246
Session 3.1 Quick Check . . . . . . . . . . . . . . . . . . . . . HTML 199 sessioN 4.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .htMl 258
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
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
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
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
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
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
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
HTML 1
HTML 2 HTML and CSS | Tutorial 1 Getting Started with HTML5
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.
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.
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.
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].
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.
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.
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.
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.
<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.
<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
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.
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.
FOOTNOTES:
ON KNOWLEDGE
ON FOREIGNERS
FROM CHAP. 1.
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: