Sikos, Ph.D. SECOND EDITION
Total Page:16
File Type:pdf, Size:1020Kb
BOOKS FOR PROFESSIONALS BY PROFESSIONALS® Sikos, Ph.D. RELATED Web Standards Web Standards: Mastering HTML5, CSS3, and XML provides solutions to the most common web design problems, and gives you a deep understanding of web standards and how they can be implemented to improve your web sites. You will learn how to develop fully standards-compliant, mobile-friendly, and search engine-optimized web sites that are robust, fast, and easy to update while providing excellent user experience and interoperability. The book covers all major web standards for markup, style sheets, web typography, web syndication, semantic annotations, and accessibility. This edition has been fully updated with the latest in web standards, including the finalized HTML5 vocabulary and the full list of CSS3 properties. Web Standards: Mastering HTML5, CSS3, and XML is also a comprehensive guide to current and future standards for the World Wide Web, demonstrating the implementation of new technologies to address the constantly growing user expectations. Web Standards: Mastering HTML5, CSS3, and XML presents step-by-step guides based on solid design principles and best practices, and shows the most common web development tools and web design frameworks. You will master HTML5 and its XML serialization, XHTML5, the new structuring and multimedia elements, the most important HTML5 APIs, and understand the standardization process of HTML 5.1, HTML 5.2, and future HTML5 versions. What You’ll Learn: • Responsive Web Design techniques to create mobile-friendly web sites using the Mobile First Approach • The most common HTML5 APIs, CSS3 properties, and jQuery functions • Cutting-edge technologies for robustness, accessibility, machine-readability, and usability • How to write structured data as HTML5 Microdata for Google Rich Snippets Shelve in ISBN 978-1-4842-0884-7 Web Development/General 54499 User level: Intermediate–Advanced SECOND EDITION SOURCE CODE ONLINE 9781484 208847 www.apress.com www.it-ebooks.info For your convenience Apress has placed some of the front matter material after the index. Please use the Bookmarks and Contents at a Glance links to access them. www.it-ebooks.info Contents at a Glance About the Author ��������������������������������������������������������������������������������������������������������������� xix About the Technical Reviewer ������������������������������������������������������������������������������������������� xxi Preface ���������������������������������������������������������������������������������������������������������������������������� xxiii ■ Part 1: Web Standards ���������������������������������������������������������������������������������� 1 ■ Chapter 1: Introduction to Web Standards ������������������������������������������������������������������������3 ■ Chapter 2: Internationalization ����������������������������������������������������������������������������������������37 ■ Chapter 3: Markup Languages: More Than HTML5 ����������������������������������������������������������53 ■ Chapter 4: Serving and Configuration ���������������������������������������������������������������������������127 ■ Chapter 5: Style Sheets �������������������������������������������������������������������������������������������������147 ■ Chapter 6: Scripting and Applications ���������������������������������������������������������������������������197 ■ Chapter 7: Metadata and the Semantic Web �����������������������������������������������������������������233 ■ Chapter 8: Web Syndication ������������������������������������������������������������������������������������������293 ■ Chapter 9: Optimized Appearance ���������������������������������������������������������������������������������317 ■ Chapter 10: Accessibility �����������������������������������������������������������������������������������������������349 ■ Part 2: Developing with Standards ����������������������������������������������������������� 385 ■ Chapter 11: Development Tools �������������������������������������������������������������������������������������387 ■ Chapter 12: Putting It All Together ��������������������������������������������������������������������������������407 iii www.it-ebooks.info ■ CONTENTS AT A GLANCE ■ Chapter 13: Best Practices ��������������������������������������������������������������������������������������������433 ■ Chapter 14: Validation ���������������������������������������������������������������������������������������������������445 ■ Chapter 15: Most Common Errors ���������������������������������������������������������������������������������471 Index ���������������������������������������������������������������������������������������������������������������������������������483 iv www.it-ebooks.info PART 1 Web Standards In this part of the book, you learn the theory and fundamental concepts of web standards, along with the standardization bodies that develop standards and the most influential web sites that announce, promote, and distribute them. After understanding the importance of web standards, you can differentiate technical specifications under development from de facto and de jure web standards. One of the very first steps in developing sites in languages other than English or creating multilingual sites is to select and declare the right character encoding. In these chapters you become familiar with the most powerful character encoding capable of representing all characters of the written languages of the world as well as widely used notations and historic scripts. The history of HTML and XHTML markup languages is crucial to understanding document types, the core document structure, and the allowed elements and attributes for the selected document type. You learn the syntax, the restrictions, and benefits of XHTML, and the extension of web documents through external vocabularies as mixed-namespace documents. By enumerating the benefits of HTML5 over HTML 4.x and XHTML, you will have a solid understanding of cutting-edge markup standards. As you will see, HTML5 can be written not only in HTML, but also in XML serialization, and web designers can create so-called polyglot documents that generate the same DOM tree regardless of the parser. You learn the role of hand coding in Web Quality Assurance, and why machine-generated code cannot compete with web designers. You also learn how to add machine-readable annotations to the markup and improve the accessibility of web sites. Without proper web server configuration, the correct appearance, operation, and behavior of web sites cannot be guaranteed. You learn about the most widely adopted application protocol, the Hypertext Transfer Protocol, and the structure of the HTTP header. The most common Internet Media Types (MIME types), the file format identifiers of the Web, are described. You see how to create permanent URIs by minimizing the information provided in them and removing file extensions on the web server. You learn why and how to separate content from appearance using Cascading Style Sheets (CSS), and what the differences are between the major CSS versions. CSS3 offers mechanisms and properties to create conditional styles depending on the features of the browsing device, create transitions and text effects, and provide beautiful typography. The chapters lead you through techniques to build core web site components based on standards. After reading these chapters, you will have a solid foundation of web standards and will be able to implement the right standards for your projects. www.it-ebooks.info CHAPTER 1 Introduction to Web Standards Technical standards are widely used in various fields of life—think of the standards of paper size and the standard envelopes that fit them, or AC power plugs and their corresponding sockets. Web standards, similar to other standards, are normative specifications of technologies and methodologies. In other words, they are well-defined sets of requirements to be satisfied. They are not only ideal from the technical point of view but also represent user needs. However, web standards are often ignored; the World Wide Web consists of billions of documents that do not consider proper restrictions or regulations, deproving user experience. This is because the Web is a “free forum” where everyone can publish pretty much anything without technical skills, content review, or censorship. Unfortunately, this approach comes at a price: you will often encounter sites that download really slow, collapse in the browser, or have poor functionality. In spite of the benefits of standard compliance, not only content authors but also web developers find it challenging to implement web standards, mainly due to the lack of widespread distribution. Even the most popular web sites can be very confusing, and in contrast to the common misconception, developers cannot use them as references to learn from. Moreover, web designers often ignore standards because of the misbelief that developing with standards means an additional workload. Due to their limited knowledge on web standards, web designers are often not familiar with the benefits of standards compliance and the best practices of standards-based web design. In this chapter, you will learn about the significance of web standards and the reliable resources you should know in order to make the best use of web standards in your web applications. This chapter sets out the major benefits of web standards. It will also give you a solid understanding of the diversity