html5 and css3 all in one for dummies 3rd edition andy harris

1.1K 492 0
html5 and css3 all in one for dummies 3rd edition andy harris

Đ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

Get More and Do More at Dummies.com® Start with FREE Cheat Sheets Cheat Sheets include • Checklists • Charts • Common Instructions • And Other Good Stuff! To access the Cheat Sheet created specifically for this book, go to www.dummies.com/cheatsheet/html5css3aio Get Smart at Dummies.com Dummies.com makes your life easier with 1,000s of answers on everything from removing wallpaper to using the latest version of Windows Check out our • Videos • Illustrated Articles • Step-by-Step Instructions Plus, each month you can win valuable prizes by entering our Dummies.com sweepstakes * Want a weekly dose of Dummies? Sign up for Newsletters on • Digital Photography • Microsoft Windows & Office • Personal Finance & Investing • Health & Wellness • Computing, iPods & Cell Phones • eBay • Internet • Food, Home & Garden Find out “HOW” at Dummies.com *Sweepstakes not currently available in all countries; visit Dummies.com for official rules HTML5 and CSS3 ALL-IN- ONE 3rd Edition by Andy Harris HTML5 and CSS3 All-in-One For Dummies®, 3rd Edition Published by: John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030-5774, www.wiley.com Copyright © 2014 by John Wiley & Sons, Inc., Hoboken, New Jersey Media and software compilation copyright © 2014 by John Wiley & Sons, Inc All rights reserved Published simultaneously in Canada 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 the prior written permission of the Publisher Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions Trademarks: Wiley, For Dummies, the Dummies Man logo, Dummies.com, Making Everything Easier, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc and may not be used without written permission All other trademarks are the property of their respective owners John Wiley & Sons, Inc is not associated with any product or vendor mentioned in this book LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRESENTATIONS OR WARRANTIES 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, please contact our Customer Care Department within the U.S at 877-762-2974, outside the U.S at 317-572-3993, or fax 317-572-4002 For technical support, please visit www.wiley.com/techsupport Wiley publishes in a variety of print and electronic formats and by print-on-demand Some material included with standard print versions of this book may not be included in e-books or in print-on-demand If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com For more information about Wiley products, visit www.wiley.com Library of Congress Control Number: 2013952425 ISBN 978-1-118-28938-9 (pbk); ISBN 978-1-118-42139-0 (ePub); ISBN 978-1-118-41983-0 (ePDF) Manufactured in the United States of America 10 Contents at a Glance Introduction Part I: Creating the HTML Foundation Chapter 1: Sound HTML Foundations Chapter 2: It’s All About Validation 19 Chapter 3: Choosing Your Tools 33 Chapter 4: Managing Information with Lists and Tables 51 Chapter 5: Making Connections with Links 67 Chapter 6: Adding Images, Sound, and Video 77 Chapter 7: Creating Forms 105 Part II: Styling with CSS 129 Chapter 1: Coloring Your World 131 Chapter 2: Styling Text 149 Chapter 3: Selectors: Coding with Class and Style 175 Chapter 4: Borders and Backgrounds 197 Chapter 5: Levels of CSS 225 Chapter 6: CSS Special Effects 245 Part III: Building Layouts with CSS 263 Chapter 1: Fun with the Fabulous Float 265 Chapter 2: Building Floating Page Layouts 285 Chapter 3: Styling Lists and Menus 309 Chapter 4: Using Alternative Positioning 327 Part IV: Client-Side Programming with JavaScript 353 Chapter 1: Getting Started with JavaScript 355 Chapter 2: Talking to the Page 375 Chapter 3: Decisions and Debugging 399 Chapter 4: Functions, Arrays, and Objects 429 Chapter 5: Getting Valid Input 459 Chapter 6: Drawing on the Canvas 483 Chapter 7: Animation with the Canvas 511 Part V: Server-Side Programming with PHP 527 Chapter 1: Getting Started on the Server 529 Chapter 2: PHP and HTML Forms 549 Chapter 3: Using Control Structures 569 Chapter 4: Working with Arrays 587 Chapter 5: Using Functions and Session Variables 605 Chapter 6: Working with Files and Directories 617 Chapter 7: Exceptions and Objects 639 Part VI: Managing Data with MySQL 653 Chapter 1: Getting Started with Data 655 Chapter 2: Managing Data with MySQL 679 Chapter 3: Normalizing Your Data 705 Chapter 4: Putting Data Together with Joins 719 Chapter 5: Connecting PHP to a MySQL Database 741 Part VII: Integrating the Client and Server with AJAX 759 Chapter 1: AJAX Essentials 761 Chapter 2: Improving JavaScript and AJAX with jQuery 775 Chapter 3: Animating jQuery 795 Chapter 4: Using the jQuery User Interface Toolkit 819 Chapter 5: Improving Usability with jQuery 841 Chapter 6: Working with AJAX Data 859 Chapter 7: Going Mobile 883 Part VIII: Moving from Pages to Sites 909 Chapter 1: Managing Your Servers 911 Chapter 2: Planning Your Sites 933 Chapter 3: Introducing Content Management Systems 953 Chapter 4: Editing Graphics 977 Chapter 5: Taking Control of Content 995 Index 1015 Table of Contents Introduction About This Book Foolish Assumptions Use Any Computer Don’t Buy Any Software How This Book Is Organized New for the Third Edition Icons Used in This Book Beyond the Book Where to Go from Part I: Creating the HTML Foundation Chapter 1: Sound HTML Foundations Creating a Basic Page Understanding the HTML in the Basic Page 11 Meeting Your New Friends, the Tags 12 Setting Up Your System 15 Displaying file extensions 15 Setting up your software 16 Chapter 2: It’s All About Validation 19 Somebody Stop the HTML Madness! 19 XHTML had some great ideas 20 Validating Your Page 23 Aesop visits W3C 25 Using Tidy to repair pages 30 Chapter 3: Choosing Your Tools 33 What’s Wrong with the Big Boys: Expression Web and Adobe Dreamweaver 33 How About Online Site Builders? 34 Alternative Web Development Tools 35 Picking a Text Editor 35 Tools to avoid unless you have nothing else 36 Suggested programmer’s editors 36 My Personal Choice: Komodo Edit 41 Other text editors 43 The bottom line on editors 44 vi HTML5 and CSS3 All-In-One For Dummies, 3rd Edition Finding a Good Web Developer’s Browser 44 A little ancient history 44 Overview of the prominent browsers 46 Other notable browsers 48 The bottom line in browsers 49 Chapter 4: Managing Information with Lists and Tables 51 Making a List and Checking It Twice 51 Creating an unordered list 51 Creating ordered lists 53 Making nested lists 54 Building the definition list 57 Building Tables 59 Defining the table 60 Spanning rows and columns 63 Avoiding the table-based layout trap 65 Chapter 5: Making Connections with Links 67 Making Your Text Hyper 67 Introducing the anchor tag 68 Comparing block-level and inline elements 69 Analyzing an anchor 69 Introducing URLs 70 Making Lists of Links 71 Working with Absolute and Relative References 73 Understanding absolute references 73 Introducing relative references 73 Chapter 6: Adding Images, Sound, and Video 77 Adding Images to Your Pages 77 Linking to an image 78 Adding inline images using the tag 80 src (source) 81 height and width 81 alt (alternate text) 81 Choosing an Image Manipulation Tool 82 An image is worth 3.4 million words 82 Introducing IrfanView 84 Choosing an Image Format 85 BMP 85 JPG/JPEG 86 GIF 86 PNG 88 SVG 89 Summary of web image formats 90 Manipulating Your Images 90 Changing formats in IrfanView 90 Resizing your images 91 Enhancing image colors 92 Table of Contents vii Using built-in effects 93 Other effects you can use 97 Batch processing 98 Working with Audio 99 Adding video 101 Chapter 7: Creating Forms 105 You Have Great Form 105 Forms must have some form 107 Building Text-Style Inputs 109 Making a standard text field 109 Building a password field 111 Making multi-line text input 112 Creating Multiple Selection Elements 114 Making selections 114 Building check boxes 116 Creating radio buttons 117 Pressing Your Buttons 119 Making input-style buttons 120 Building a Submit button 121 It’s a do-over: The Reset button 121 Introducing the tag 121 New form input types 122 date 122 time 123 datetime 123 datetime-local 123 week 124 month 125 color 125 number 125 range 126 search 126 email 127 tel 127 url 127 Part II: Styling with CSS 129 Chapter 1: Coloring Your World 131 Now You Have an Element of Style 131 Setting up a style sheet 133 Changing the colors 134 Specifying Colors in CSS 134 Using color names 135 Putting a hex on your colors 136 Coloring by number 136 viii HTML5 and CSS3 All-In-One For Dummies, 3rd Edition Hex education 137 Using the web-safe color palette 139 Choosing Your Colors 140 Starting with web-safe colors 141 Modifying your colors 141 Doing it on your own pages 141 Changing CSS on the fly 142 Creating Your Own Color Scheme 143 Understanding hue, saturation, and lightness 143 Using HSL colors in your pages 145 Using the Color Scheme Designer 146 Selecting a base hue 147 Picking a color scheme 148 Chapter 2: Styling Text 149 Setting the Font Family 149 Applying the font-family style attribute 150 Using generic fonts 151 Making a list of fonts 153 The Curse of Web-Based Fonts 154 Understanding the problem 154 Using Embedded Fonts 155 Using images for headlines 158 Specifying the Font Size 160 Size is only a suggestion! 160 Using the font-size style attribute 161 Absolute measurement units 162 Relative measurement units 163 Determining Other Font Characteristics 164 Using font-style for italics 165 Using font-weight for bold 166 Using text-decoration 167 Using text-align for basic alignment 169 Other text attributes 170 Using the font shortcut 171 Working with subscripts and superscripts 172 Chapter 3: Selectors: Coding with Class and Style 175 Selecting Particular Segments 175 Defining more than one kind of paragraph 175 Styling identified paragraphs 176 Using Emphasis and Strong Emphasis 177 Modifying the Display of em and strong 179 Defining Classes 180 Adding classes to the page 181 Index url( ) keyword, 213–214 url input type, 127, 884 URLs (Uniform Resource Locators), 70–71 usernames, as part of URL, 71 V validation color names, 135 defined, 21 example of end tag error, 32 overlapping tag error, 29–30 overview of errors, 26 sample page with errors, 23–24 strategies for working through errors, 26–27 title error, 27–29 of form-based input, 470–473 multilevel lists, 315 nested lists, 57 new simplifications for :invalid pseudo-class, 479–480 patterns, 481 placeholder text, 481–482 required fields, 481 with regular expressions defined, 473 general discussion, 472–473 marking beginning and end of lines, 476 operators, 473–474 pattern memory, 478 repetition operations, 477–478 using characters in, 475–476 using special characters in, 476–477 tables, 63 validators defined, 21–22 reasons for using, 30 submitting code to, 22 Tidy, 30–32 W3C, 22, 25–30 validation filters, 560 validators defined, 21–22 reasons for using, 30 1065 submitting code to, 22 Tidy fix suggestions, 31 problems with, 31–32 website for, 30 W3C overlapping tag error, 29–30 overview of errors, 26 strategies for working through errors, 26–27 submitting code to, 22 title error, 27–29 website for, 25 value attribute, 111, 120–121, 125–126 value property, 388, 461, 463, 467 VALUES keyword, 683 var command, 361 VARCHAR(length) data type, 658, 660 variable scope, 408 defined, 437 implications of, 437–439 managing, 609–610 variables arrays accessing data, 440–441 associative, 594–597 breaking strings into, 601–603 containing elements of different types, 440 for dealing with complexity, 447 defined, 429, 438–439 example of, 442–443 general discussion, 439–440 listed data as, 465 multidimensional, 444–449, 597–600 one-dimensional, 587–590 using loops with, 441–442, 590–594 assigning values to, 369 characteristics of, 361 comparing with literals, 363 concatenation, 541–542 converting to desired type, 372–374 defined, 361 general discussion, 359–360 interpolating into text, 542–543 loose typing, 540 1066 HTML5 and CSS3 All-In-One For Dummies, 3rd Edition variables (continued) naming, 609 numeric values, 369 overview, 540 program for adding numbers, 369–370 program for adding numbers provided by user, 370 requesting user input, 361 responding to user input, 361–362 vector images, 89 vector-based image editors, 978 vertical-align attribute, 170 VI (Visual Editor) text editor, 39–40 video embedding, 102 externally linked, 103 formats, 101 tags, 101–102 view source command, 395–396, 815 viewport indicators, 884–885, 888 views characteristics of, 727 creating, 726–727 defined, 726 for encapsulating joins, 733 MySQL 4.0 and, 728 VIM (Visual Editor Improved) text editor, 39 virtual fields, 719–721 virtual fonts, 151–153 visited link state defined, 187 styling, 189 :visited pseudo-class, 189 Visual Editor Improved (VIM) text editor, 39 Visual Editor (VI) text editor, 39–40 VLC video conversion tool, 101 W W3C (World Wide Web Consortium) defined, 20 validator overlapping tag error, 29–30 overview of errors, 26 strategies for working through errors, 26–27 submitting code to, 22 title error, 27–29 website for, 25 XHTML standards, 20 watch expressions, 419 WAV format, 100 web browsers animation, 261 Apple Safari debugging in, 420 features of, 47–48 general discussion, 10 hiding toolbar, 906–907 image borders, 208 auditory, 49 calendar controls, 122–125 choosing, 49 color pickers, 125 CSS incompatibility “Best viewed with” disclaimers, 237 conditional comments, 238–240 coping with, 237–238 CSS resets, 243 hacks, 238 Internet Explorer version, 242 Internet Explorer-specific code, 238–240 JavaScript-based browser detection, 238 parallel pages, 238 debugging in, 418–423 defined, 10 downloading multiple, 17 exclusive features, 19 Fire Vox, 49 flexible box layouts, 348–350 Google Chrome console, 376–377, 420–423 CSS coding in, 142–143 debugging in, 418–422, 815 Developer Tools window, 376, 418–419 features of, 47–48 general discussion, 10 image borders, 208 viewing generated source code, 396–397 Index history of, 44–46 HTML5 standards, 45–46 image borders, 208 Internet Explorer black border shading, 200 conditional comments, 238–240 CSS incompatibility, 237 debugging in, 420 First Browser Wars, 44 general discussion, 10 HTML5 support in IE9, 46 HTML5 support in IE10, 46 image borders, 208 margins and padding, 298, 339 versions of, 242 JavaScript and, 356–357 loading pages into browser, 11 Lynx, 48 menu systems, 321 Mosaic, 44 Mozilla Firefox debugging in, 420 features of, 46–47 general discussion, 10 image borders, 208 origin of, 45 viewing generated source code, 397 Netscape, 44–45 number input, 125–126 Opera, 48, 208 as part of client-side development system, 912 reflection effects, 247–249 resizing images, 83 resizing text, 161 search input, 126–127 table borders, 60–61 text effects, 250 text-only, 48–49 in three-tiered architecture, 662 transformations, 254, 257 viewing generated source code, 395–398 WebKit rendering engine, 45, 47–48 web development tools content management systems, 34–35 multimedia tools, 35 1067 programming technologies, 35 text editors choosing, 35, 44 enhanced, 35 suggested, 36–44 word processors versus, 36 web browser plug-ins, 35 web page editors Adobe Dreamweaver, 33–34 Microsoft Expression Web, 33–34 problems with, 19–20 web hosts connecting to hosting services, 922 finding hosting services, 920–921 general discussion, 920 reasons for using, 920 remote site management file permissions, 924–925 with FTP, 925–928 web-based file tools, 922–924 Web Inspector tool, Safari, 420 web page editors Adobe Dreamweaver features of, 33 problems with, 34 Microsoft Expression Web features of, 33 problems with, 34 problems with, 19–20 web page names, as part of URL, 71 web page templates CSS styling for, 936, 947–949 data framework for, 936, 949–950 design sketches, 943–944 guidelines for, 943 HTML framework for, 936, 945–946 web pages filenames, 10 loading page into browser, 11 saving file, 10 text editors, 9–10 typing code, 10 web browsers, 10 web servers defined, 532 as part of server-side system, 913 1068 HTML5 and CSS3 All-In-One For Dummies, 3rd Edition web servers (continued) in three-tiered architecture, 662 ways of working with, 533 web services, 870 web-based fonts, 154–155 WebKit rendering engine, 45, 47–48 -webkit-border-image attribute, 208 web-safe color palette, 139–141 website planning audience identifying, 937–938 technical expertise of, 938–939 characteristics of complete websites, 933–934 for clients clear expectations, 935–936 general discussion, 934 task delineation, 936–937 efficiency, 951 large sites, 934, 953–954 launching sites, 950–951 page templates CSS styling for, 936, 947–949 data framework for, 936, 949–950 design sketches, 943–944 guidelines for, 943 HTML framework for, 936, 945–946 semantic navigation, 942 site plans defined, 939–940 diagrams, 940–942 strategies for, 940–941 testing, 936, 947, 950–951 WEBSITE_HEADER constant, 974 WEBSITE_TITLE constant, 974 WebsiteBaker adding content, 962–963 adding functionality, 970–971 adding templates, 969–970 administration tools, 962 changing info.php file, 973–974 changing templates, 968 characteristics of, 958 creation and editing tools, 963–967 installing, 958–961 modifying CSS files, 975–976 modifying index.php file, 974–975 packaging templates, 976 page types Code, 965 Form, 966 Menu Link, 966 News V3.5, 966–967 Wrapper, 966–967 WYSIWYG, 962, 965 prebuilt templates, 971–973 websites for further information author’s, 6, 797 Cheat Sheet for book, Color Scheme Designer tool, 146 companion to book, content management systems, 955 CSS resets, 242 CSS3 column example, 308 Dummies.com online articles, FileZilla, 926 Firebug extension, 420 font conversion tool, 157 Freehostia, 672 gedit text editor, 38 Gimp image manipulation program, 979 Gimp tutorials and manual, 982 hosting services, 920 HTTP response codes, 770 image supply sites, 981 IrfanView, 84 jQuery, 777, 820 jQuery methods, 814 Komodo Edit, 9, 41 media query specification, 894 mobile themeRoller tool, 896 Multiflex-3 template, 970 MySQL Workbench, 710 open-source fonts, 157 PHP date( ) function format, 551 PHP fopen( ) function, 619 PHP readdir( ) function, 634 Shakespearean insult generator, 175 SVG images, 90 TextWrangler, Tidy validator, 30 Index updates for book, W3C validator, 22, 25 WebsiteBaker AMASP, 970 WebsiteBaker documentation, 975 WebsiteBaker downloads, 959 WebsiteBaker templates, 969, 972 XAMPP server package, 533 WEEK( ) function, 720 week input type, 124–125 WEEKDAY( ) function, 720 WHERE clause, 691, 696–697, 736 while loops creating, 413–414 for loops versus, 585 for passwords, 414–417 PHP programming, 584–586 problems with, 586 reading from text files, 626 troubleshooting, 415–416 widgets, jQuery accordion tool, 821, 841–845 classes used on, 831–832 datepicker controls, 821, 851–852 defined, 841 dialog boxes, 821, 856–858 icons, 822 progress bars, 821 selectable elements, 854–855 sliders (scroll bars), 821, 851–852 sortable lists, 855–856 tabs tool, 821, 842 improving usability with, 849–850 tabbed interfaces, 845–848 using with AJAX, 848–849 width attribute, 81, 198, 330, 334 width property, 275 window object, 377 Windows Notepad, 9, 36 Windows Paint, 978 WOFF font format, 157 Word, 10, 36 word processors defining tables in HTML versus, 60 text editors versus, 10, 36 word spacing, 170 1069 WordPress, 956–957 word-spacing attribute, 170 World Wide Web Consortium (W3C) defined, 20 validator overlapping tag error, 29–30 overview of errors, 26 strategies for working through errors, 26–27 submitting code to, 22 title error, 27–29 website for, 25 XHTML standards, 20 wrap( ) function, 519–520 wrap( ) method, 816 write access, 619–620 write permission, 924 www host name, 70 WYSIWYG technology, 17, 33–34, 62 X XAMPP components of, 914 creating servers with adding files, 916–917 general discussion, 914–915 running, 915 security levels, 917–919 security versus functionality, 919–920 testing configuration, 916 defined, installing, 533 phpMyAdmin, 663–664 XEmacs text editor, 40 XHTML standards attributes in quotes, 21 end tags, 20 failure of, 20 layout separate from markup, 21 lowercase, 21 overlapping tags, 20 Tidy validator output, 32 xip utility, 976 1070 HTML5 and CSS3 All-In-One For Dummies, 3rd Edition XML (eXtensible Markup Language) AJAX and, 763–764 exporting data and structure, 702–703 general discussion, 20, 870–871 HTML framework for, 873 JSON versus, 457 manipulating, 872–873 processing results, 874–875 retrieving, 874 XMLHttpRequest object, 761, 763, 767–768, 772 XnView, 85 Y Yahoo User Interface (YUI) library, 776 YEAR( ) function, 720, 723, 724–725 YouTube, 103 YUI (Yahoo User Interface) library, 776 Z z-index attribute, 331–332 zIndex property, 840 Zoom tool, Gimp, 985–986 zValue variable, 840 About the Author Andy Harris began his teaching life as a special education teacher As he was teaching young adults with severe disabilities, he taught himself enough computer programming to support his teaching habit with freelance programming Those were the exciting days when computers started to have hard drives, and some computers began communicating with each other over an arcane mechanism some were calling the Internet All this time Andy was teaching computer science part time He joined the faculty of the Indiana University-Purdue University Indianapolis Computer Science department in 1995 He serves as a Senior Lecturer, teaching the introductory course to freshmen as well as numerous courses on web development, general programming, and game programming As manager of the Streaming Media Laboratory, he developed a number of online videobased courses, and worked on a number of international distance education projects including helping to start a computer science program in Tetevo, Macedonia FYR, and collaboration with Sun-Yat-Sen University in Guangzhou, China Andy is active in home schooling, and is the technology columnist for a national homeschool magazine Andy is the author of several other computing books including HTML5 Game Development For Dummies, JavaScript/AJAX for Dummies, and Game Programming: The L Line He invites your comments and questions at andy@aharrisbooks.net You can visit his main site and find a blog, forum, and links to other books at www.aharrisbooks.net Dedication I dedicate this book to Jesus Christ, my personal savior, and to Heather, the joy in my life I also dedicate this project to Elizabeth, Matthew, Jacob, and Benjamin I love each of you Author’s Acknowledgments Thank you first to Heather Even though I type all the words, this book is a real partnership, like the rest of our life Thanks for being my best friend and companion Thanks also for doing all the work it takes for us to sustain a family when I’m in writing mode Thank you to Connie Santisteban I’ve really enjoyed working with you on this project Thank you to the copy and development editor, Linda Morris I appreciate your efforts to make my geeky mush turn into something readable Thanks for improving my writing A special thanks to Claudia Snell for technical editing I appreciate your vigilance You have helped to make this book as technically accurate as possible Thank you to the many people at Wiley who contribute to a project like this The author only gets to meet a few people, but so many more are involved in the process Thank you very much for all you’ve done to help make this project a reality A big thank you to the open-source community which has created so many incredible tools and made them available to all I’d especially like to thank the creators of Firefox, Firebug, Aptana, HTML Validator, Komodo Edit, Notepad++, PHP, Apache, jQuery, and the various jQuery plug-ins This is an amazing and generous community effort Thanks to those I’ve gotten to learn and teach with, from the graduate students, to the math homework girls: Graciela and Vanesa I’d finally like to thank the IUPUI computer science family for years of support on various projects Thank you especially to all my students, current and past I’ve learned far more from you than the small amount I’ve taught Thank you for letting me be a part of your education Publisher’s Acknowledgments Acquisitions Editor: Constance Santisteban Project Coordinator: Sheree Montgomery Project Editor: Linda Morris Cover Image: © iStockphoto.com/Marina Strizhak Copy Editor: Linda Morris Technical Editor: Claudia Snell Editorial Assistant: Annie Sullivan Sr Editorial Assistant: Cherie Case Get More and Do More at Dummies.com® Start with FREE Cheat Sheets Cheat Sheets include • Checklists • Charts • Common Instructions • And Other Good Stuff! To access the Cheat Sheet created specifically for this book, go to www.dummies.com/cheatsheet/html5css3aio s p p A e l Mobi Get Smart at Dummies.com Dummies.com makes your life easier with 1,000s of answers on everything from removing wallpaper to using the latest version of Windows Check out our • Videos • Illustrated Articles • Step-by-Step Instructions Plus, each month you can win valuable prizes by entering our Dummies.com sweepstakes * Want a weekly dose of Dummies? Sign up for Newsletters on • Digital Photography • Microsoft Windows & Office • Personal Finance & Investing • Health & Wellness • Computing, iPods & Cell Phones • eBay • Internet • Food, Home & Garden Find out “HOW” at Dummies.com *Sweepstakes not currently available in all countries; visit Dummies.com for official rules There’s a Dummies App for This and That With more than 200 million books in print and over 1,600 unique titles, Dummies is a global leader in how-to information Now you can get the same great Dummies information in an App With topics such as Wine, Spanish, Digital Photography, Certification, and more, you’ll have instant access to the topics you need to know in a format you can trust To get information on all our Dummies apps, visit the following: www.Dummies.com/go/mobile from your computer www.Dummies.com/go/iphone/apps from your phone ... Garden Find out “HOW” at Dummies. com *Sweepstakes not currently available in all countries; visit Dummies. com for official rules HTML5 and CSS3 ALL- IN- ONE 3rd Edition by Andy Harris HTML5 and CSS3. .. 731 xx HTML5 and CSS3 All- In- One For Dummies, 3rd Edition Counting the advantages of inner joins 732 Building a view to encapsulate the join 733 Managing Many-to-Many Joins ... HTML5 and CSS3 All- In- One For Dummies, 3rd Edition Introduction I love the Internet, and if you picked up this book, you probably do, too The Internet is dynamic, chaotic, exciting, interesting, and

Ngày đăng: 01/01/2019, 08:32

Từ khóa liên quan

Mục lục

  • Contents at a Glance

  • Table of Contents

  • Introduction

    • About This Book

    • Foolish Assumptions

    • Use Any Computer

    • Don’t Buy Any Software

    • How This Book Is Organized

    • New for the Third Edition

    • Icons Used in This Book

    • Beyond the Book

    • Where to Go from

  • Part I: Creating the HTML Foundation

    • Chapter 1: Sound HTML Foundations

      • Creating a Basic Page

      • Understanding the HTML in the Basic Page

      • Meeting Your New Friends, the Tags

      • Setting Up Your System

    • Chapter 2: It’s All About Validation

      • Somebody Stop the HTML Madness!

      • Validating Your Page

      • Using Tidy to repair pages

    • Chapter 3: Choosing Your Tools

      • What’s Wrong with the Big Boys: Expression Web and Adobe Dreamweaver

      • How About Online Site Builders?

      • Alternative Web Development Tools

      • Picking a Text Editor

      • Finding a Good Web Developer’s Browser

    • Chapter 4: Managing Information with Lists and Tables

      • Making a List and Checking It Twice

      • Building Tables

    • Chapter 5: Making Connections with Links

      • Making Your Text Hyper

      • Making Lists of Links

      • Working with Absolute and Relative References

    • Chapter 6: Adding Images, Sound, and Video

      • Adding Images to Your Pages

      • Choosing an Image Manipulation Tool

      • Choosing an Image Format

      • Manipulating Your Images

      • Working with Audio

    • Chapter 7: Creating Forms

      • You Have Great Form

      • Building Text-Style Inputs

      • Making a standard text field

      • Building a password field

      • Creating Multiple Selection Elements

      • Pressing Your Buttons

      • New form input types

  • Part II: Styling with CSS

    • Chapter 1: Coloring Your World

      • Now You Have an Element of Style

      • Specifying Colors in CSS

      • Choosing Your Colors

      • Creating Your Own Color Scheme

    • Chapter 2: Styling Text

      • Setting the Font Family

      • The Curse of Web-Based Fonts

      • Specifying the Font Size

      • Relative measurement units

      • Determining Other Font Characteristics

    • Chapter 3: Selectors: Coding with Class and Style

      • Selecting Particular Segments

      • Using Emphasis and Strong Emphasis

      • Modifying the Display of em and strong

      • Defining Classes

      • Introducing div and span

      • Using Pseudo-Classes to Style Links

      • Selecting in Context

      • Defining Styles for Multiple Elements

      • Using New CSS3 Selectors

    • Chapter 4: Borders and Backgrounds

      • Joining the Border Patrol

      • Introducing the Box Model

      • New CSS3 Border Techniques

      • Changing the Background Image

      • Manipulating Background Images

      • Using Images in Lists

    • Chapter 5: Levels of CSS

      • Managing Levels of Style

      • Understanding the Cascading Part of Cascading Style Sheets

      • Managing Browser Incompatibility

    • Chapter 6: CSS Special Effects

      • Image Effects

      • Text Effects

      • Transformations and Transitions

  • Part III: Building Layouts with CSS

    • Chapter 1: Fun with the Fabulous Float

      • Avoiding Old-School Layout Pitfalls

      • Introducing the Floating Layout Mechanism

      • Using Float with Block-Level Elements

      • Using Float to Style Forms

    • Chapter 2: Building Floating Page Layouts

      • Creating a Basic Two-Column Design

      • Building a Three-Column Design

      • Building a Fixed-Width Layout

      • Building a Centered Fixed-Width Layout

    • Chapter 3: Styling Lists and Menus

      • Revisiting List Styles

      • Creating Dynamic Lists

      • Building a Basic Menu System

    • Chapter 4: Using Alternative Positioning

      • Working with Absolute Positioning

      • Managing z-index

      • Building a Page Layout with Absolute Positioning

      • Creating a More Flexible Layout

      • Exploring Other Types of Positioning

      • Flexible Box Layout Model

      • Determining Your Layout Scheme

  • Part IV: Client-Side Programming with JavaScript

    • Chapter 1: Getting Started with JavaScript

      • Working in JavaScript

      • Writing Your First JavaScript Program

      • Introducing Variables

      • Using Concatenation to Build Better Greetings

      • Understanding the String Object

      • Understanding Variable Types

      • Changing Variables to the Desired Type

    • Chapter 2: Talking to the Page

      • Understanding the Document Object Model

      • Managing Button Events

      • Managing Text Input and Output

      • Writing to the Document

      • Working with Other Text Elements

    • Chapter 3: Decisions and Debugging

      • Making Choices with If

      • Managing Repetition with for Loops

      • Building While Loops

      • Managing Errors with a Debugger

    • Chapter 4: Functions, Arrays, and Objects

      • Breaking Code into Functions

      • Passing Data to and from Functions

      • Managing Scope

      • Building a Basic Array

      • Working with Two-Dimension Arrays

      • Creating Your Own Objects

      • Introducing JSON

    • Chapter 5: Getting Valid Input

      • Getting Input from a Drop-Down List

      • Managing Multiple Selections

      • Check, Please: Reading Check Boxes

      • Working with Radio Buttons

      • Interpreting Radio Buttons

      • Working with Regular Expressions

      • New HTML5/CSS3 Tricks for Validation

    • Chapter 6: Drawing on the Canvas

      • Canvas Basics

      • Fill and Stroke Styles

      • Drawing Essential Shapes

      • Working with Paths

      • Images

      • Manipulating Pixels

    • Chapter 7: Animation with the Canvas

      • Transformations

      • Animation

      • Reading the Keyboard

  • Part V: Server-Side Programming with PHP

    • Chapter 1: Getting Started on the Server

      • Introducing Server-Side Programming

      • Installing Your Web Server

      • Inspecting phpinfo( )

      • Building HTML with PHP

      • Coding with Quotation Marks

      • Working with Variables PHP-Style

      • Building HTML Output

    • Chapter 2: PHP and HTML Forms

      • Exploring the Relationship between PHP and HTML

      • Sending Data to a PHP Program

      • Choosing the Method of Your Madness

      • Retrieving Data from Other Form Elements

    • Chapter 3: Using Control Structures

      • Introducing Conditions (Again)

      • Building the Classic if Statement

      • Making a switch

      • Looping with for

      • Looping with while

    • Chapter 4: Working with Arrays

      • Using One-Dimensional Arrays

      • Using Loops with Arrays

      • Introducing Associative Arrays

      • Introducing Multidimensional Arrays

      • Breaking a String into an Array

    • Chapter 5: Using Functions and Session Variables

      • Creating Your Own Functions

      • Managing Persistence with Session Variables

    • Chapter 6: Working with Files and Directories

      • Text File Manipulation

      • Using Delimited Data

      • Working with File and Directory Functions

    • Chapter 7: Exceptions and Objects

      • Object-Oriented Programming in PHP

      • You’ve Got Your Momma’s Eyes: Inheritance

      • Catching Exceptions

  • Part VI: Managing Data with MySQL

    • Chapter 1: Getting Started with Data

      • Examining the Basic Structure of Data

      • Introducing MySQL

      • Setting Up phpMyAdmin

      • Implementing a Database with phpMyAdmin

    • Chapter 2: Managing Data with MySQL

      • Writing SQL Code by Hand

      • Running a Script with phpMyAdmin

      • Using AUTO_INCREMENT for Primary Keys

      • Selecting Data from Your Tables

      • Editing Records

      • Exporting Your Data and Structure

    • Chapter 3: Normalizing Your Data

      • Recognizing Problems with Single-Table Data

      • Introducing Entity-Relationship Diagrams

      • Introducing Normalization

      • Identifying Relationships in Your Data

    • Chapter 4: Putting Data Together with Joins

      • Calculating Virtual Fields

      • Calculating Date Values

      • Creating a View

      • Using an Inner Join to Combine Tables

      • Managing Many-to-Many Joins

    • Chapter 5: Connecting PHP to a MySQL Database

      • PHP and MySQL: A Perfect (but Geeky) Romance

      • Allowing User Interaction

  • Part VII: Integrating the Client and Server with AJAX

    • Chapter 1: AJAX Essentials

      • AJAX Spelled Out

      • Making a Basic AJAX Connection

      • All Together Now — Making the Connection Asynchronous

    • Chapter 2: Improving JavaScript and AJAX with jQuery

      • Introducing jQuery

      • Your First jQuery App

      • Creating an Initialization Function

      • Investigating the jQuery Object

      • Adding Events to Objects

      • Making an AJAX Request with jQuery

    • Chapter 3: Animating jQuery

      • Playing Hide and Seek

      • Changing Position with jQuery

      • Modifying Elements on the Fly

    • Chapter 4: Using the jQuery User Interface Toolkit

      • What the jQuery User Interface Brings to the Table

      • Resizing on a Theme

      • Dragging, Dropping, and Calling Back

    • Chapter 5: Improving Usability with jQuery

      • Multi-Element Designs

      • Improving Usability

    • Chapter 6: Working with AJAX Data

      • Sending Requests AJAX Style

      • Building a Multipass Application

      • Working with XML Data

      • Working with JSON Data

    • Chapter 7: Going Mobile

      • Thinking in Mobile

      • Building a Responsive Site

      • Making Your Page Responsive

      • Using jQuery Mobile to Build Mobile Interfaces

      • Going from Site to App

  • Part VIII: Moving from Pages to Sites

    • Chapter 1: Managing Your Servers

      • Understanding Clients and Servers

      • Creating Your Own Server with XAMPP

      • Choosing a Web Host

      • Managing a Remote Site

      • Naming Your Site

      • Managing Data Remotely

    • Chapter 2: Planning Your Sites

      • Creating a Multipage Web Site

      • Planning a Larger Site

      • Understanding the Client

      • Understanding the Audience

      • Building a Site Plan

      • Creating Page Templates

      • Fleshing Out the Project

    • Chapter 3: Introducing Content Management Systems

      • Overview of Content Management Systems

      • Previewing Common CMSs

      • Building Custom Themes

    • Chapter 4: Editing Graphics

      • Using a Graphic Editor

      • Choosing an Editor

      • Introducing Gimp

      • Understanding Layers

      • Introducing Filters

      • Solving Common Web Graphics Problems

    • Chapter 5: Taking Control of Content

      • Building a “Poor Man’s CMS” with Your Own Code

      • Creating Your Own Data-Based CMS

  • Index

  • About the Author

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

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

Tài liệu liên quan