wrox beginning web programming with html xhtml and css 2nd edition apr 2008

770 826 0
wrox beginning web programming with html xhtml and css 2nd edition apr 2008

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Beginning Web Programming with HTML, XHTML, and CSS Second Edition Jon Duckett 59313ffirs.qxd:WroxPro 3/22/08 2:30 PM Page v 59313ffirs.qxd:WroxPro 3/22/08 2:30 PM Page iv Beginning Web Programming with HTML, XHTML, and CSS Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii Chapter 1: Creating Structured Documents . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Chapter 2: Links and Navigation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Chapter 3: Images and Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Chapter 4: Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Chapter 5: Forms. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 Chapter 6: Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 Chapter 7: Cascading Style Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 Chapter 8: More Cascading Style Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . 273 Chapter 9: Page Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 Chapter 10: Design Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361 Chapter 11: Learning JavaScript. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403 Chapter 12: Working with JavaScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453 Chapter 13: Putting Your Site on the Web . . . . . . . . . . . . . . . . . . . . . . . . . 501 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 59313ffirs.qxd:WroxPro 3/22/08 2:30 PM Page i 59313ffirs.qxd:WroxPro 3/22/08 2:30 PM Page ii Beginning Web Programming with HTML, XHTML, and CSS Second Edition 59313ffirs.qxd:WroxPro 3/22/08 2:30 PM Page iii 59313ffirs.qxd:WroxPro 3/22/08 2:30 PM Page iv Beginning Web Programming with HTML, XHTML, and CSS Second Edition Jon Duckett 59313ffirs.qxd:WroxPro 3/22/08 2:30 PM Page v From library of Wow! eBook www.wowebook.com Beginning Web Programming with HTML, XHTML, and CSS, Second Edition Published by Wiley Publishing, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com Copyright © 2008 by Wiley Publishing, Inc., Indianapolis, Indiana ISBN: 978-0-470-25931-3 Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, or online at http://www.wiley.com/go /permissions . Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or war- ranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Website is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Website may provide or recommendations it may make. Further, readers should be aware that Internet Websites listed in this work may have changed or disappeared between when this work was written and when it is read. For general information on our other products and services or to obtain technical support, please contact our Customer Care Department within the U.S. at (800) 762-2974, outside the U.S. at (317) 572-3993 or fax (317) 572-4002. Library of Congress Cataloging-in-Publication Data is available from the publisher. Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. All other trademarks are the property of their respective owners. Wiley Publishing, Inc. is not associated with any product or vendor mentioned in this book. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. 59313ffirs.qxd:WroxPro 3/22/08 2:30 PM Page vi About the Author 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. About the Technical Editor Ben Schupak holds a master’s degree in computer science and has more than nine years of professional programming experience for large corporations and U.S. federal departments. He lives in the New York metro area and enjoys traveling. 59313ffirs.qxd:WroxPro 3/22/08 2:30 PM Page vii 59313ffirs.qxd:WroxPro 3/22/08 2:30 PM Page viii [...]... idea of what else is possible and what you need to learn to do that I have included several helpful appendixes, including a reference to the XHTML elements and CSS properties There is an appendix that explains how XHTML and CSS specify colors Other appendixes show you available character encodings, language codes, and escape characters that can be used with HTML, XHTML, CSS and JavaScript Finally, there... 59313c01.qxd:WroxPro 3/22/08 2:32 PM Page 1 1 Creating Str uctured Documents In this chapter, you meet the first technologies you need to learn in order to write web pages: HTML and XHTML In fact, what you will really be learning is XHTML although I will be explaining the differences between HTML and XHTML as we go along (As I already mentioned, you can consider XHTML simply to be the latest version of HTML. )... you needed to learn only one language to write web pages: HTML As the Web has advanced, however, so have the technologies you need to learn in order to create effective and attractive web pages As the title of this book suggests, you will be learning a few different languages: ❑ HTML and XHTML: HTML and XHTML are needed to explain the structure of any web pages They’re used to indicate what text should... order to tell a web browser the structure of a document—how to make a heading, a paragraph, a table, and so on—you need to learn HTML and XHTML Introducing XHTML XHTML, or Extensible Hypertext Markup Language, and its predecessor HTML, are the most widely used languages on the Web As its name suggests, XHTML is a markup language, which may sound complicated, until you realize that you come across markup... what text should be considered a heading, where paragraphs start and end, and what images should appear in the document, and to specify links between different pages As you might be relieved to hear, you shouldn’t think of HTML and XHTML as two separate languages Rather, you can consider XHTML as more like the latest version of HTML ❑ CSS: CSS is used to control how a document should appear For example,... technologies used to create web pages have matured, and favored methods, or “best practices,” for creating web sites have been emerging It is these that you will be learning About the Book As you have already seen, you’ll be learning how to control the structure of a web page with HTML and XHTML, how to style it with CSS, and how to add interactivity with JavaScript Just learning about the latest technologies,... to write is based on what are known as web standards; HTML, XHTML, and CSS are all created and maintained by the World Wide Web Consortium, or W3C (www.w3.org/), an organization dedicated to creating specifications for the Web You will also learn about some features that are not standards; it is helpful to know some of these in case you come across such markup and need to know what it does (In such... technologies, such as XHTML, and encourages you to embrace web standards that not only meet the needs of the new devices that access the Web, but also help make your sites available to more visitors You don’t need any previous programming experience to work with this book This is one of the first steps on the programming ladder Whether you are just a hobbyist or want to make a career of web programming, this... information and, if appropriate, post a message to the book’s errata page and fix the problem in subsequent editions of the book p2p .wrox. com For author and peer discussion, join the P2P forums at p2p .wrox. com The forums are a web- based system for you to post messages related to Wrox books and related technologies and interact with other readers and technology users The forums offer a subscription feature to... and attributes As you will see, these elements and attributes describe the structure of a document (what is a heading, what is a paragraph of text, what is a link, and so on) The first six chapters of the book describe the different elements and attributes that make up HTML and XHTML and how you can use them to write web pages The chapters are organized into task-related areas, xxv 59313flast.qxd:WroxPro . Beginning Web Programming with HTML, XHTML, and CSS Second Edition Jon Duckett 59313ffirs.qxd:WroxPro 3/22/08 2:30 PM Page v 59313ffirs.qxd:WroxPro 3/22/08 2:30 PM Page iv Beginning Web Programming. 715 59313ffirs.qxd:WroxPro 3/22/08 2:30 PM Page i 59313ffirs.qxd:WroxPro 3/22/08 2:30 PM Page ii Beginning Web Programming with HTML, XHTML, and CSS Second Edition 59313ffirs.qxd:WroxPro 3/22/08. 2:30 PM Page iii 59313ffirs.qxd:WroxPro 3/22/08 2:30 PM Page iv Beginning Web Programming with HTML, XHTML, and CSS Second Edition Jon Duckett 59313ffirs.qxd:WroxPro 3/22/08 2:30 PM Page v From

Ngày đăng: 31/03/2014, 16:51

Từ khóa liên quan

Mục lục

  • Beginning Web Programming with HTML, XHTML, and CSS, Second Edition

    • About the Author

    • About the Technical Editor

    • Credits

    • Contents

    • Introduction

      • About the Book

      • Whom This Book Is For

      • What This Book Covers

      • What You Need to Use This Book

      • How This Book Is Organized

      • Conventions

      • Source Code

      • Errata

      • p2p.wrox.com

    • Chapter 1: Creating Structured Documents

      • A Web of Structured Documents

      • Introducing XHTML

      • Core Elements and Attributes

      • Attribute Groups

      • Basic Text Formatting

      • Presentational Elements

      • Phrase Elements

      • Lists

      • Editing Text

      • Using Character Entities for Special Characters

      • Comments

      • The <font> Element (deprecated)

      • Understanding Block and Inline Elements

      • Grouping Elements with <div> and <span>

      • Summary

      • Exercises

    • Chapter 2: Links and Navigation

      • Basic Links

      • Understanding Directories and Directory Structures

      • Creating Links with the <a> Element

      • Advanced E-mail Links

      • Summary

      • Exercises

    • Chapter 3: Images and Objects

      • Adding Images to Your Site

      • Adding Other Objects with the <object> Element

      • Using Images as Links

      • Image Maps

      • Summary

      • Exercises

    • Chapter 4: Tables

      • Introducing Tables

      • Basic Table Elements and Attributes

      • Advanced Tables

      • Accessibility Issues with Tables

      • Summary

      • Exercises

    • Chapter 5: Forms

      • Introducing Forms

      • Creating a Form with the <form> Element

      • Form Controls

      • Creating Labels for Controls and the <label> Element

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

      • Focus

      • Disabled and Read-Only Controls

      • Sending Form Data to the Server

      • Summary

      • Exercises

    • Chapter 6: Frames

      • Introducing the Frameset

      • When to Use Frames

      • The <frameset> Element

      • The <frame> Element

      • The <noframes> Element

      • Creating Links Between Frames

      • Nested Framesets

      • Floating or Inline Frames with <iframe>

      • Summary

      • Exercises

    • Chapter 7: Cascading Style Sheets

      • Introducing CSS

      • Where You Can Add CSS Rules

      • CSS Properties

      • Controlling Fonts

      • Text Formatting

      • Text Pseudo-Classes

      • Selectors

      • Lengths

      • Percentages

      • Introducing the Box Model

      • Summary

      • Exercises

    • Chapter 8: More Cascading Style Sheets

      • Links

      • Backgrounds

      • Lists

      • Tables

      • Outlines

      • The :focus and :active Pseudo-Classes

      • Generated Content

      • Miscellaneous Properties

      • Additional Rules

      • Positioning with CSS

      • Summary

      • Exercises

    • Chapter 9: Page Layout

      • Understanding the Site

      • Page Size (and Screen Resolution)

      • Designing Pages

      • Structuring Pages

      • Summary

      • Exercises

    • Chapter 10: Design Issues

      • Text

      • Navigation

      • Shading Multiple Rows of a Table

      • Forms

      • Summary

      • Exercises

    • Chapter 11: Learning JavaScript

      • What Is Programming About?

      • How to Add a Script to Your Pages

      • The Document Object Model

      • Starting to Program with JavaScript

      • Variables

      • Operators

      • Functions

      • Conditional Statements

      • Looping

      • Events

      • Built-in Objects

      • Writing JavaScript

      • Summary

      • Exercises

    • Chapter 12: Working with JavaScript

      • Practical Tips for Writing Scripts

      • Form Validation

      • Form Enhancements

      • Image Rollovers

      • Random Script Generator

      • Pop-Up Windows

      • JavaScript Libraries

      • When Not to Use JavaScript

      • Summary

      • Exercises

    • Chapter 13: Putting Your Site on the Web

      • Meta Tags

      • Testing Your Site

      • Taking the Leap to Live

      • What Next?

      • Introducing Other Technologies

      • Summary

    • Appendix A: Answers to Exercises

      • Chapter 1

      • Chapter 2

      • Chapter 3

      • Chapter 4

      • Chapter 5

      • Chapter 6

      • Chapter 7

      • Chapter 8

      • Chapter 9

      • Chapter 10

      • Chapter 11

      • Chapter 12

    • Appendix B: XHTML Element Reference

      • Core Attributes

      • <a> (all)

      • <abbr> (IE4+, N6+, FF1+)

      • <acronym> (IE4+, N6+, FF1+)

      • <address> (all)

      • <applet> Deprecated (all)

      • <param> (all)

      • <area> (all)

      • <b> (all)

      • <base>

      • <basefont> Deprecated (all)

      • <bdo> (IE5+, N6+, FF1+)

      • <bgsound> (IE only — IE3+)

      • <big> (IE4+, N4+, FF1)

      • <blink> (Netscape/Firefox only — N3+, FF1+)

      • <blockquote> (all)

      • <body> (all)

      • <br /> (all)

      • <button> (IE4+, N3+, FF1+)

      • <caption> (all)

      • <center> Deprecated (all)

      • <cite> (all)

      • <code> (all)

      • <col> (IE3+, N4+, FF1+)

      • <colgroup> (IE3+, N4+, FF1+)

      • <comment> (IE4+ only)

      • <dd> (all)

      • <del> (IE4+, N6+, FF1+)

      • <dfn> (all)

      • <dir> Deprecated (all)

      • <div> (all)

      • <dl> (all)

      • <dt> (all)

      • <em> (all)

      • <embed> (all)

      • <fieldset> (IE4+, N6+, FF1+)

      • <font> Deprecated (all)

      • <form> (all)

      • <frame> (all)

      • <noframes> (all)

      • <frameset> (all)

      • <head> (all)

      • <hn> (all)

      • <hr /> (all)

      • <html> (all)

      • <i> (all)

      • <iframe> (IE3+, N6+, FF1+)

      • <img> (all)

      • <input type="button"> (all)

      • <input type="checkbox"> (all)

      • <input type="file"> (all)

      • <input type="hidden"> (all)

      • <input type="image"> (all)

      • <input type="password"> (all)

      • <input type="radio"> (all)

      • <input type="reset"> (all)

      • <input type="submit"> (all)

      • <input type="text"> (all)

      • <ins> (IE4+, N6+, FF1+)

      • <isindex> Deprecated (all)

      • <kbd> (all)

      • <keygen> (Netscape only, N3+)

      • <label> (IE4+, N6+, FF1+)

      • <layer> (Netscape only, N4+)

      • <legend> (IE4+, N6+, FF1+)

      • <li> (all)

      • <link> (all)

      • <listing> Deprecated (IE3+)

      • <map> (all)

      • <marquee> (IE only, IE3+)

      • <menu> Deprecated (all)

      • <meta> (all)

      • <multicol> (N3, N4 only)

      • <nextid> (not supported in browsers)

      • <nobr> (all)

      • <noembed> (N2, N3, N4)

      • <noframes> (all)

      • <nolayer> (N4+ only)

      • <noscript> (all)

      • <object> (IE3+, N6+, FF1+)

      • <ol> (all)

      • <optgroup> (IE6+, N6+, FF1+)

      • <option> (all)

      • <p> (all)

      • <param>

      • <plaintext> Deprecated (IE3+, N2, N3, N4)

      • <pre> (all)

      • <q> (IE4+, N6+, FF1+)

      • <s> Deprecated (all)

      • <samp> (all)

      • <script> (all)

      • <select> (all)

      • <small> (all)

      • <span> (all)

      • <strike> Deprecated (all)

      • <strong> (all)

      • <style> (IE3+, N4+, FF1+)

      • <sub> (all)

      • <sup> (all)

      • <table> (all)

      • <tbody> (IE3+, N6+, FF1+)

      • <td> (all)

      • <textarea> (all)

      • <tfoot> (IE3+, N6+, FF1+)

      • <thead> (IE3+, N6+, FF1+)

      • <th> (all)

      • <title> (all)

      • <tr> (all)

      • <tt> (all)

      • <u> (all)

      • <ul> (all)

      • <var> (IE3+, N6+, FF1+)

      • <wbr> (IE3, N2, N3, N4)

      • <xmp> Deprecated (all)

    • Appendix C: CSS Properties

      • Font Properties

      • Text Properties

      • Color and Background Properties

      • Border properties

      • Dimensions

      • Margin Properties

      • Padding Properties

      • List Properties

      • Positioning Properties

      • Outline Properties

      • Table Properties

      • Classification Properties

      • Internationalization Properties

      • Lengths

    • Appendix D: Color Names and Values

      • Using Hex Codes to Specify Colors

      • Understanding Hex Codes

      • Using Color Names to Specify Colors

      • Hex Codes versus Color Names

      • Color Name and Number Reference

    • Appendix E: Character Encodings

    • Appendix F: Special Characters

    • Appendix G: Language Codes

    • Appendix H: MIME Media Types

      • text

      • image

      • multipart

      • audio

      • video

      • message model application

    • Appendix I: Deprecated and Browser-Specific Markup

      • Why Deprecated Markup Exists

      • Older Pages Break Many Rules

      • Fonts

      • Backgrounds

      • Formatting

      • Links

      • Lists

      • Tables

      • Miscellaneous Attributes

      • IE-Specific Elements

      • Netscape-Specific Elements and Attributes

    • Index

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan