Print this page Share

Beginning Web Programming with HTML, XHTML, and CSS, 2nd Edition

ISBN: 978-0-470-25931-3
768 pages
April 2008
Beginning Web Programming with HTML, XHTML, and CSS, 2nd Edition (0470259310) cover image


This beginning guide reviews HTML and also introduces you to using XHTML for the structure of a web page and cascading style sheets (CSS) for controlling how a document should appear on a web page. You?ll learn how to take advantage of the latest features of browsers while making sure that your pages still work in older, but popular, browsers. By incorporating usability and accessibility, you?ll be able to write professional-looking and well-coded web pages that use the latest technologies.
See More

Table of Contents

Introduction xxiii

Chapter 1: Creating Structured Documents 1

A Web of Structured Documents 1

Introducing XHTML 2

Core Elements and Attributes 9

Attribute Groups 12

Basic Text Formatting 16

Presentational Elements 26

Phrase Elements 29

Lists 36

Editing Text 45

Using Character Entities for Special Characters 47

Comments 47

The <font> Element (deprecated) 48

Understanding Block and Inline Elements 48

Grouping Elements with <div> and <span> 49

Summary 50

Exercises 51

Chapter 2: Links and Navigation 53

Basic Links 54

Understanding Directories and Directory Structures 57

Creating Links with the <a> Element 65

Advanced E-mail Links 74

Summary 75

Exercises 76

Chapter 3: Images and Objects 77

Adding Images to Your Site 77

Adding Other Objects with the <object> Element 93

Using Images as Links 99

Image Maps 100

Summary 105

Exercises 106

Chapter 4: Tables 109

Introducing Tables 109

Basic Table Elements and Attributes 112

Advanced Tables 125

Accessibility Issues with Tables 132

Summary 136

Exercises 136

Chapter 5: Forms 139

Introducing Forms 140

Creating a Form with the <form> Element 141

Form Controls 145

Creating Labels for Controls and the <label> Element 169

Structuring Your Forms with <fieldset> and <legend> Elements 171

Focus 173

Disabled and Read-Only Controls 176

Sending Form Data to the Server 178

Summary 183

Exercises 183

Chapter 6: Frames 185

Introducing the Frameset 185

When to Use Frames 188

The <frameset> Element 189

The <frame> Element 194

The <noframes> Element 197

Creating Links Between Frames 198

Nested Framesets 200

Floating or Inline Frames with <iframe> 204

Summary 209

Exercises 209

Chapter 7: Cascading Style Sheets 211

Introducing CSS 212

Where You Can Add CSS Rules 217

CSS Properties 221

Controlling Fonts 223

Text Formatting 230

Text Pseudo-Classes 239

Selectors 243

Lengths 249

Percentages 251

Introducing the Box Model 251

Summary 270

Exercises 270

Chapter 8: More Cascading Style Sheets 273

Links 274

Backgrounds 275

Lists 283

Tables 287

Outlines 294

The :focus and :active Pseudo-Classes 296

Generated Content 297

Miscellaneous Properties 301

Additional Rules 304

Positioning with CSS 305

Summary 320

Exercises 321

Chapter 9: Page Layout 323

Understanding the Site 323

Page Size (and Screen Resolution) 330

Designing Pages 337

Structuring Pages 346

Summary 359

Exercises 359

Chapter 10: Design Issues 361

Text 362

Navigation 369

Shading Multiple Rows of a Table 378

Forms 380

Summary 401

Exercises 401

Chapter 11: Learning JavaScript 403

What Is Programming About? 404

How to Add a Script to Your Pages 406

The Document Object Model 410

Starting to Program with JavaScript 422

Variables 423

Operators 424

Functions 427

Conditional Statements 429

Looping 432

Events 435

Built-in Objects 437

Writing JavaScript 449

Summary 451

Exercises 452

Chapter 12: Working with JavaScript 453

Practical Tips for Writing Scripts 453

Form Validation 456

Form Enhancements 470

Image Rollovers 482

Random Script Generator 485

Pop-Up Windows 486

JavaScript Libraries 487

When Not to Use JavaScript 496

Summary 498

Exercises 498

Chapter 13: Putting Your Site on the Web 501

Meta Tags 502

Testing Your Site 508

Taking the Leap to Live 517

What Next? 529

Introducing Other Technologies 531

Summary 537

Appendix A: Answers to Exercises 539

Appendix B: XHTML Element Reference 563

Appendix C: CSS Properties 607

Appendix D: Color Names and Values 637

Appendix E: Character Encodings 645

Appendix F: Special Characters 649

Appendix G: Language Codes 665

Appendix H: MIME Media Types 669

Appendix I: Deprecated and Browser-Specific Markup 681

Index 715

See More

Author Information

Jon Duckett published his first web site in 1996 while studying for a BSc (Hons) in Psychology at Brunel University, London. Since then, he has helped create a wide variety of web sites for companies of all sizes. He has also co-written more than ten programming-related books on topics from ASP to XML (via many other letters of the alphabet), covering diverse aspects of web programming including design, architecture, and coding.
See More


Download TitleSizeDownload
ReadMe 2.06 KB Click to Download
Chapter 1 Code 14.38 KB Click to Download
Chapter 2 Code
Updated 5/27/11 to correct misspelling of "Desserts" in the link to the dessert section of the Wrox Cafe Menu in Exercise 1.
6.13 KB Click to Download
Chapter 3 Code 111.22 KB Click to Download
Chapter 4 Code 6.94 KB Click to Download
Chapter 5 Code 14.93 KB Click to Download
Chapter 6 Code 97.49 KB Click to Download
Chapter 7 Code 30.05 KB Click to Download
Chapter 8 Code 34.31 KB Click to Download
Chapter 9 Code 18.39 KB Click to Download
Chapter 10 Code 295.76 KB Click to Download
Chapter 11 Code 11.76 KB Click to Download
Chapter 12 Code 2.49 MB Click to Download
Appendix I Code 14.25 KB Click to Download
CSS 401 bytes Click to Download
All Code
Updated 5/27/11 to correct misspelling of "Desserts" in the link to the dessert section of the Wrox Cafe Menu in Exercise 1 of Chapter 2.
3.19 MB Click to Download
See More


Do you think you've discovered an error in this book? Please check the list of errata below to see if we've already addressed the error. If not, please submit the error via our Errata Form. We will attempt to verify your error; if you're right, we will post a correction below.

ChapterPageDetailsDatePrint Run
35 Error in Text
The last line on the page should say Figure 17, not Figure 15
39 Error in Text
The highlighted line in the middle of the page (under the heading "Using the start Attribute to Change the Starting Number in Ordered Lists") should say:

< ol type="A" start="4" >
56 Error in Text
The example on line 3 reads: "why not visit the<a href..."
There should be a space between "the" and the link tag. The line should read "why not visit the <a href..."
2 76 Error in Link
The link to the dessert section of the Wrox Cafe Menu in Exercise 1 of Chapter 2 does not work because the link is misspelled.

It is spelled desert; it should be dessert.

The version of the Chapter 2 exercise1.html file now available in the code downloads reflects this correction.
99 Missing word -Typo
first paragraph about the embed element--Text reads:
(small programs that not part of the browser).

should read:
(small programs that are not part of the browser).
153 Error in Text
Here are some examples of using the < button > element (ch06_eg06.html):

should be

Here are some examples of using the < button > element (ch05_eg06.html):
5 165 Error in Text
Text reads:
"For a name and value can still be sent to the server for a hidden form control, the hidden control must carry name and value attributes."

Should read:
"For a name and value to be sent to the server...."
218 Error in text
the Rel attribute: "the other...are discussed in Chapter1."

should be:

Chapter 2
427 Error in Text
On page 427, the author describes the Logic or boolean operators.

In the logical operator table, he has used the notation ?? to describe logical OR, which should be ||.
See More
Back to Top