Tải bản đầy đủ (.pdf) (10 trang)

Tự học HTML và CSS trong 1 giờ - part 2 pot

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (509.24 KB, 10 trang )

ptg
Image Backgrounds 238
Specifying Backgrounds for Elements
241
Using Images As Bullets
242
What Is an Imagemap?
243
ImageMaps and Text-Only Browsers
244
Getting an Image
244
Determining Your Coordinates
245
The <map> and <area> Tags
248
The usemap Attribute
249
Image Etiquette
254
Summary
255
Workshop
256
Q&A
256
Quiz
257
Quiz Answers
258
Exercises


258
LESSON 10: Building Tables 259
Creating Tables 260
Table Parts
260
The <table> Element
261
The Table Summary
261
Rows and Cells
262
Empty Cells
264
Captions
265
Sizing Tables, Borders, and Cells
269
Setting Table Widths
269
Changing Table Borders
270
Cell Padding
273
Cell Spacing
274
Column Widths
275
Setting Breaks in Text
278
Table and Cell Color

280
Aligning Your Table Content
282
Table Alignment
282
Cell Alignment
283
Caption Alignment
286
x
Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day
Download from www.wowebook.com
ptg
Spanning Multiple Rows or Columns 287
More Advanced Table Enhancements
296
Grouping and Aligning Columns
296
Grouping and Aligning Rows
300
Other Table Elements and Attributes
303
How Tables Are Used
303
Summary
304
Workshop
309
Q&A
309

Quiz
309
Quiz Answers
310
Exercises
310
LESSON 11: Designing Forms 311
Understanding Form and Function 312
Using the <form> Tag
317
Using the <label> Tag
320
Creating Form Controls with the <input> Tag
321
Creating Text Controls
322
Creating Password Controls
323
Creating Submit Buttons
324
Creating Reset Buttons
325
Creating Check Box Controls
325
Creating Radio Buttons
326
Using Images as Submit Buttons
327
Creating Generic Buttons
328

Hidden Form Fields
329
The File Upload Control
329
Using Other Form Controls
330
Using the button Element
330
Creating Large Text-Entry Fields with textarea
331
Creating Menus with select and option
332
Grouping Controls with fieldset and legend
340
Changing the Default Form Navigation
341
Using Access Keys
342
Creating disabled and readonly Controls
342
Contents
xi
Download from www.wowebook.com
ptg
Applying Cascading Style Sheet Properties to Form Elements 343
Planning Your Forms
349
Summary
350
Workshop

351
Q&A
351
Quiz
352
Quiz Answers
352
Exercises
353
LESSON 12: Integrating Multimedia: Sound, Video, and More 355
Embedding Video the Simple Way 356
Advantages and Disadvantages of Hosting Videos on YouTube
357
Uploading Videos to YouTube
358
Customizing the Video Player
359
Other Services
360
Hosting Your Own Video
361
Video and Container Formats
362
Converting Video to H.264
363
Converting Video to Ogg Theora
366
Embedding Video Using <video>
366
The <video> Tag

367
Using the <source> Element
369
Embedding Flash Using the <object> Tag
370
Alternative Content for the <object> Tag
374
The <embed> Tag
375
Embedding Flash Movies Using SWFObject
376
Flash Video Players
378
JW Player
378
Using Flowplayer
380
Using the <object> Tag with the <video> Tag
382
Embedding Audio in Your Pages
383
The <audio> Tag
383
Flash Audio Players
384
Summary
385
Workshop
386
Q&A

386
Quiz
387
xii
Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day
Download from www.wowebook.com
ptg
Quiz Answers 387
Exercises
388
LESSON 13: Advanced CSS: Page Layout in CSS 389
Laying Out the Page 390
The Problems with Layout Tables
390
Writing HTML with Structure
391
Writing a Layout Style Sheet
394
The Floated Columns Layout Technique
401
The Role of CSS in Web Design
403
Style Sheet Organization
404
Sitewide Style Sheets
407
Summary
408
Workshop
408

Q&A
408
Quiz
409
Quiz Answers
409
Exercises
410
PART IV: Using JavaScript and Ajax
LESSON 14: Introducing JavaScript 411
Why Would You Want to Use JavaScript? 412
Ease of Use
412
Increasing Server Efficiency
413
Integration with the Browser
413
The <script> Tag
414
The Structure of a JavaScript Script
414
The src Attribute
415
The JavaScript Language
415
Operators and Expressions
417
Variables
418
Control Structures

421
Functions
424
Data Types
426
Arrays
427
Objects
427
Contents
xiii
Download from www.wowebook.com
ptg
The JavaScript Environment 428
Events
429
Summary
432
Workshop
433
Q&A
433
Quiz
433
Quiz Answers
434
Exercises
434
LESSON 15: Using JavaScript in Your Pages 435
Validating Forms with JavaScript 436

Hiding and Showing Elements
443
Adding New Content to a Page
452
Summary
456
Workshop
456
Q&A
456
Quiz
457
Quiz Answers
457
Exercises
457
LESSON 16: Using JavaScript Libraries 459
What Are JavaScript Libraries? 460
Reviewing the Popular JavaScript Libraries
460
jQuery
461
Dojo
461
Yahoo! UI
461
Prototype
461
Other Libraries
462

Getting Started with jQuery
462
Your First jQuery Script
463
Binding Events
465
Modifying Styles on the Page
466
Hiding and Showing Elements
466
Retrieving and Changing Style Sheet Properties
467
Modifying Content on the Page
468
Manipulating Classes
468
Manipulating Form Values
471
xiv
Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day
Download from www.wowebook.com
ptg
Manipulating Attributes Directly 473
Adding and Removing Content
474
Special Effects
478
AJAX and jQuery
480
Using AJAX to Load External Data

481
Summary
485
Workshop
485
Q&A
485
Quiz
486
Quiz Answers
486
Exercises
487
LESSON 17: Working with Frames and Linked Windows 489
What Are Frames? 490
Working with Linked Windows
491
The <base> Tag
496
Working with Frames
498
The <frameset> Tag
499
The <frame> Tag
502
The <noframes> Tag
503
Changing Frame Borders
504
Creating Complex Framesets

507
Magic target Names
520
Inline Frames
521
Opening Linked Windows with JavaScript
523
Summary
526
Workshop
529
Q&A
529
Quiz
529
Quiz Answers
530
Exercises
530
PART V: Designing Effective Web Pages
LESSON 18: Writing Good Web Pages: Do’s and Don’ts 531
Standards Compliance and Web Browsers 532
Progressive Enhancement
532
Contents
xv
Download from www.wowebook.com
ptg
Choosing a Document Type 534
HTML5

535
Validating Your Pages
535
HTML Tidy
538
Writing for Online Publication
538
Write Clearly and Be Brief
539
Organize Your Pages for Quick Scanning
539
Make Each Page Stand on Its Own
541
Be Careful with Emphasis
541
Don’t Use Browser-Specific Terminology
542
Spell Check and Proofread Your Pages
543
Design and Page Layout
543
Use Headings as Headings
543
Group Related Information Visually
544
Use a Consistent Layout
545
Using Links
546
Use Link Menus with Descriptive Text

546
Use Links in Text
547
Avoid the “Here” Syndrome
549
To Link or Not to Link
550
Using Images
552
Don’t Overuse Images
552
Keep Images Small
553
Watch Out for Assumptions About Your Visitors’ Hardware
555
Be Careful with Backgrounds and Link Colors
555
Making the Most of CSS and JavaScript
556
Put Your CSS and JavaScript in External Files
556
Location Matters
557
Shrink Your CSS and JavaScript
557
Other Good Habits and Hints
558
Link Back to Home
558
Don’t Split Topics Across Pages

558
Don’t Create Too Many or Too Few Pages
558
Sign Your Pages
561
Summary
562
Workshop
564
xvi
Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day
Download from www.wowebook.com
ptg
Q&A 564
Quiz
565
Quiz Answers
565
Exercises
566
LESSON 19: Designing for the Real World 567
What Is the Real World, Anyway? 568
Considering User Experience Level
569
Add a Search Engine
569
Use Concise, Sensible URLs
570
Navigation Provides Context
572

Are Your Users Tourists or Regulars?
573
Determining User Preference
573
Migrating to HTML5
575
Benefits of HTML5
575
What’s Not in HTML5
577
Using HTML5
577
HTML5 and XML
578
XHTML 1.0 and HTML 4.01
579
What Is Accessibility?
579
Common Myths Regarding Accessibility
579
Section 508
580
Alternative Browsers
581
Writing Accessible HTML
582
Tables
582
Links
583

Images
584
Designing for Accessibility
586
Use Color
586
Fonts
586
Take Advantage of All HTML Tags
587
Frames and Linked Windows
587
Forms
587
Validating Your Sites for Accessibility
588
Summary
590
Workshop
590
Contents
xvii
Download from www.wowebook.com
ptg
Q&A 590
Quiz
591
Quiz Answers
592
Exercises

592
PART VI: Part VI: Going Live on the Web
LESSON 20: Putting Your Site Online 593
What Does a Web Server Do? 594
Other Things Web Servers Do
594
How to Find Web Hosting
595
Using a Web Server Provided by Your School or Work
595
Using a Commercial Web Host
596
Setting Up Your Own Server
597
Free Hosting
597
Organizing Your HTML Files for Publishing
598
Questions to Ask Your Webmaster
598
Keeping Your Files Organized with Directories
599
Having a Default Index File and Correct Filenames
599
Publishing Your Files
600
Moving Files Between Systems
600
Troubleshooting
603

I Can’t Access the Server
603
I Can’t Access Files
603
I Can’t Access Images
604
My Links Don’t Work
604
My Files Are Being Displayed Incorrectly
605
Registering and Advertising Your Web Pages
605
Getting Links from Other Sites
606
Promoting Your Site Through Social Media
606
Creating a Facebook Page for Your Site
607
Site Indexes and Search Engines
609
Google
609
Yahoo!
610
Microsoft Bing
610
Ask.com
610
Search Engine Optimization
611

Paying for Search Placement
612
xviii
Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day
Download from www.wowebook.com
ptg
Business Cards, Letterhead, Brochures, and Advertisements 612
Finding Out Who’s Viewing Your Web Pages
612
Log Files
613
Google Analytics
614
Installing Google Analytics
614
Summary
616
Workshop
616
Q&A
617
Quiz
617
Quiz Answers
617
Exercises
618
LESSON 21: Taking Advantage of the Server 619
How PHP Works 620
Getting PHP to Run on Your Computer

621
The PHP Language
622
Comments
622
Variables
623
Arrays
624
Strings
626
Conditional Statements
628
PHP Conditional Operators
629
Loops
630
foreach Loops
630
for Loops
631
while and do while Loops
632
Controlling Loop Execution
632
Built-in Functions
633
User-Defined Functions
634
Returning Values

635
Processing Forms
636
Handling Parameters with Multiple Values
637
Presenting the Form
642
Using PHP Includes
647
Choosing Which Include Function to Use
649
Expanding Your Knowledge of PHP
650
Contents
xix
Download from www.wowebook.com

×