Web standards : mastering HTML5, CSS3, and XML ; [create ... - GBV

5 downloads 175 Views 427KB Size Report
Contents. J m About the Author xvii. About the Technical Reviewer xviii. Preface xix. Parti: Web Standards. 1 m Chapter 1: Introduction to Web Standards. 3.
Web Standards Mastering HTML5, CSS3,

Leslie F.

and XML

Sikos, Ph.D. Apress*

Contents

J m

About the Author

xvii

About the Technical Reviewer Preface

m

xix

Parti: Web Standards

1

Chapter 1: Introduction to Web Standards

3

The Basic

3

Concepts

The Role of Standardization The Cost of Nonstandardized Benefits of

Markup

Standard-Compliant Markup

Development and Announcement of Standards

4 4

5

6

W3C

7

WHATWG

8

ERCIM

8

IETF

8

Ecma International

8

Unicode Consortium

8

DCMI

9

IANA

9

OASIS

9

ISO

9

Standards Promotion and Distribution

iv

xviii

9

CONTENTS

Groups and Associations

10

Staying Informed: Events and Courses

11

Resources

12

Types, Stages, and The

Status of Standards

Variety of Rendering Engines

12 13

Trident

14

Gecko

15

KHTML

16

WebKit

16

Presto

16

Amaya

17

Testing the Standard Support of Browsers

17

Standard Compliance Tests

17

Comprehensive Tests

19

Standards

vs.

Quirks Modes, DOCTYPE Switching

Problem Statement Server-Side Technologies and Content Limited Standards

19

20 Management

Support in Development Tools

21 22

Major Concerns

22

Bad Practices

22

Lack of

22

Support

Unconcern

23

Influential Sites

23

The

24

Popularity of Flash

Well-formedness

25

Interoperability

26

Eliminated Version Targeting

27

Backward

28

Compatibility

v

«

CONTENTS

Forward

29

Functionality

29

Device

29

Independence

Separating Content from Presentation

30

Usability

30

Reliable

h

Compatibility

Layouts

31

Code Optimality

31

Summary

31

References

31

Chapter 2: Internationalization

39

The Importance of Character Encoding

39

Unicode

41

Characters That Should Be Avoided in

Markup Contexts

44

Formatting Characters Suitable Also for Markup

46

Special Characters

46

NFC Normalization Is Recommended

47

Unicode Should Be Preferred

48

Declaring Character Encoding for the Markup

48

Encoding Declaration in the HTTP Header

49

In-Document Declarations

49

Declaring Character Encoding for CSS

50

HTTP Header Declarations

50

In-Document Declarations

50

Escape Codes, Special Characters, and Symbols

51

Numeric References

51

Entity References

51

Checking

118N

52

m CONTENTS

Summary

52

References

53

Chapter

3:

Markup Languages: More Than HTML5

SGML Languages

56

HTML

XML

56

57

Languages

XHTML

57

Version Overview

57

HTML Versions and Variants XHTML Versions and

Variants

HTML5

The HTML

Syntax

The XHTML

Syntax and Restrictions

Types

Markup Elements Block

vs.

58 59

64

Markup Syntaxes

Data

55

Inline Elements

Attributes

HTML Document Structure

66 66 67

74 77 86

87

102

Document Type Declaration

106

XHTML Document Structure

112

Moving from HTML to XHTML

120

Specific Markup Languages

121

SVG

121

MathML

124

Combinations, Profiles, and Mixed-Namespace Documents (X)HTML+RDFa

127 127

vii

CONTENTS

XHTML-Print

128

XHTML+ MathML +SVG

129

Choosing

a

Markup Language

The Benefits of XHTML 1.x over HTML 4.x.

131

The Benefits of HTML5

132

Alternatives to Web

s

over

HTML 4.x and XHTML

Markup

133

References

133

Chapter 4: Serving and Configuration

139

The HTTP Header

139

Internet Media Types (MIME)

140

Serving XHTML

141

147

Serving XHTML as HTML

147

Serving XHTML as XML

147

URIs, URLs, and URNs

149

Persistent URIs

viii

132

Summary

Common Media Types

»

131

150

Summary

155

References

155

Chapter 5: Style Sheets

161

Cascading Style Sheets

161

Levels, Profiles, and Modules

162

Grammar and Conventions

163

Implementation

178

Display and Visibility

181

Cascading

181

Inheritance

183

*

CONTENTS

Scopes and Structure

184

The Box Model

185

Overview of CSS Properties

187

Initial Property Values

204

Default Styles of Rendering Engines

204

XSL XSLT

206 Style Sheets

Combining

CSS and XSL..

206

209

Summary

210

References

210

Chapter 6: Scripting and Applications

213

Client-Server Architectures

213

Scripting and Standards Implementation

214

Client-Side Development

215

Ajax

215

Flex

216

HTML5 APIs

217

Java Applets

229

ECMAScript and JavaScript

230

Silverlight

233

Server-Side Development

234

ColdFusion

235

Java

235

The .NET Framework

235

Perl

236

PHP

236

Python

238

ix

a

CONTENTS

m

Ruby

238

SSJS

238

Combinations of Client-Side and Server-Side Technologies

238

Database

239

Technologies

Alternate Content and Fallback Mechanism for Scripts

239

Summary

240

References

240

Chapter 7: Metadata and the Semantic

245

The Semantic Web

245

Structured Data

247

Linked

248

Open Data

Wide Variety of Annotations and Syntaxes

249

The

250

metaTags

Schemas, Vocabularies, and Ontologies

251

Microformats

253

Microdata

261

FOAF

263

DOAC

265

Dublin Core

266

Resource

274

Description Framework

OWL

283

Metadata

287

Combining Vocabularies in RDF

288

Microdata and Microformats

289

Dublin Core and vCard in RDF

290

Dublin Core, vCard, and Math-Net

290

DC, IMS, and ODRL

291

Combining

x

Web

«

Special Applications

CONTENTS

292

Image Metadata and XMP

292

Metadata for YouTube Videos

294

Metadata in SEO

295

Summary

296

References

297

Chapter 8: Web Syndication

307

News Feeds

307

Really Simple Syndication

307

Creating

an

RSS File

308

Required Elements

309

Optional Elements

310

Subelements of the item Element

319

Namespaces

322

Styling RSS Feeds

323

324

Atom

Creating

an

Atom File

325

Containers

326

Metadata and Content Elements

328

RSS

or

Atom?

331

Summary

332

References

332

Chapter 9: Optimized Appearance

335

Layout

335

Positioning and Floating

335

Tableless Web Layout

336

Typography

342 xi

CONTENTS

Misused Characters

342

Web Fonts

343

Embedding External

Content

Graphics

347

Vector Graphics

355

Flash

355

Audio

357

Video

358

Summary

363

References

363

Raster

Accessibility

367

Defining Web Accessibility

367

Chapter

10:

WCAG1.0

369

WCAG2.0

370

Migrating from WCAG1.0 to WCAG 2.0 U.S. Section 508

Semantic

xii

(X)HTML5 Elements and WAI-ARIA

392 393

394

JavaScript Accessibility

394

PDF

395

Accessibility

Flash

*

347

Accessibility

397

Accessibility of Mathematical Notations

397

Summary

398

References

398

Part 2: Developing with Standards

401

Chapter 11: Development Tools

403

Feature Requirements

403

*

CONTENTS

Text Editors

404

WYSIWYG Editors

406

Content Management Systems and Bloggers

408

Web Standards

Support

409

410

Specific Editors Semantic Editors and Reasoners

410

MathType

411

Markup Correctors

412

HTML Tidy

412

Tidy for PHP

413

Log Validator

413

Browsers

as

Development Tools

Debugging and Add-ons

413 ,

413

Testing Web Pages in Text Browsers

414

View the Source Code

415

Summary

415

References

416

Chapter 12: Putting It All Together

419

Choosing the Relevant Standards

419

Switching Between Standards

Step-by-Step Development

419

420

Starting from Scratch

420

Links

427

Images

428

Lists

428

Tables

432

Drop-Down Selection Lists

436

xiii

si

CONTENTS

Forms

437

Flash Content

439

RSS News Feeds

440

Making Web

m

Sites Valid

441

Through Redesign

Summary

441

References

442

Chapter 13: Best Practices

443

Appropriately Used Elements

443

Content in

443

Reliable

Logical

Order

444

Positioning

444

Sizes and Proportions Lengths in Relative Units

445

Combine Units Properly

445

446

Embedding External Content Properly Embedding YouTube Videos as Valid XHTML Embedding Google Maps

as

Valid XHTML

HTML5

HTML5

447 448

Semantic Web Best Practices

450

WAI-ARIA Best Practices

450

Mobile Web Best Practices

450

Providing Robustness

451

Declaring Fallback Generic Fonts Declarations with Appropriate

Specificity

Testing

xiv

or

or

451 452

452

Rendering in Multiple Browsers

452

Readability Without Styles

452

Summary

453

References

453

fe

'

CONTENTS

Chapter 14: Validation

455

Concepts

455

Markup Validation

456

Validating XML

460

Validating RDF/XML

460

Validating News Feeds

462

Validating CSS

462

Validating 118N

463

Validating Hyperlinks

464

Validating Accessibility

464

Validating Mobile-Friendliness

467

Unified Validators

467

W3C Unicorn

.'

468

Total Validator

469

SortSite

470

Extracting Semantic Content

471

Expressing Validity

474

W3C loops

475

Representing Technologies

476

Summary

478

References

478

Chapter 15: Most Common Errors

481

Common

Serving Errors

481

Common

Markup Errors

481

Incorrectly Used Elements

481

Incorrect Structure

483

xv

CONTENTS

Misused Tables

483

Nonoptimal Code Length

484

Element and Attribute Errors

484

End

484

Tag Errors

485

Identifiers

Common Style Sheet Errors Nonexisting Properties Nonexisting

or

Incorrectly Used Property Values

485 485

Ignored Inheritance

486

Color Errors

487

Incorrect Locations

488

Transparent Backgrounds

488

Miscellaneous Errors

488

Common News Feed Errors Common

xvi

485

Script Errors

489 489

Common Accessibility Errors

489

Summary

490

References

490

Index

491