Browser Support for HTML5

Slides:



Advertisements
Similar presentations
Cascading Style Sheets
Advertisements

XHTML Basics.
Tutorial 4: Designing a Web Page with Tables
Web Accessibility Tests Using the Firefox Browser ACCESS to Postsecondary Education through Universal Design for Learning.
TUTORIAL 8: Enhancing a Web Site with Advanced CSS
 jQuery Mobile An Introduction. What is jQuery Mobile  A framework built on top of jQuery, used for creating mobile web applications  Designed to make.
IMAGES Controlling size of images in CSS Aligning images in CSS Adding background images.
Session: 11. © Aptech Ltd. 2HTML5 Audio and Video / Session 11  Describe the need for multimedia in HTML5  List the supported media types in HTML5 
INTRODUCTION TO CLIENT-SIDE WEB PROGRAMMING ACM 511 ACM 262 Course Notes.
Mobile App Support Jacob Poirier Geri Hengesbach Andrea Menke Erin Rossell.
Using Styles and Style Sheets for Design
Lesson 4: Using HTML5 Markup.  The distinguishing characteristics of HTML5 syntax  The new HTML5 sectioning elements  Adding support for HTML5 elements.
Chapter 2 Developing a Web Page. Chapter 2 Lessons Introduction 1.Create head content and set page properties 2.Create, import, and format text 3.Add.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
Bare bones notes. Suggested organization for main folder. REQUIRED organization for the 115 folder.
MIS 425 Lecture 3 – HTML 5 and CSS Instructor: Martin Neuhard
UPLOAD / DOWNLOAD april  HTML5 is just the next iteration of HTML  Previous version was technically HTML 4.01, which incorporated XHTML 1.0.
Lesson 9. * Testing Your browser * Using different browser tools * Using conditional comments with * Dealing with future compatibility problems.
May 6, 2009 Browser Compatibility Testing Definition It is a non functional type of testing where web based applications are tested on various browsers(IE.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Web Design Principles 5 th Edition Chapter 3 Writing HTML for the Modern Web.
1 Company Confidential Skin a Complete DotNetNuke Website Using HTML5 and CSS3 in One Hour Amelia Marschall Partner & Creative Director.
CONCEPTS FOR FLUID LAYOUT Web Page Layout. Essential Questions What challenges do mobile devices present to Web designers? What are the basic concepts.
Web Standards Web Design – Sec 2-3 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials.
JavaScript Part 1 Introduction to scripting The ‘alert’ function.
And Mobile Web Browsers
Chapter 9 HTML 5 Video and Audio
The HTML5 logo was introduced by W3C in 2010
Chapter 17 The Need for HTML 5.
Getting Started with HTML
HTML Extra Markup CS 1150 Spring 2017.
HTML5 Basics.
Implementing Responsive Design UNIT I.
Bare boned notes.
Implementing Responsive Design
Links and Comments in HTML5
Chapter 2 Developing a Web Page.
Web Standards Web Design – Sec 2-3
Introduction to HTML.
Concepts for fluid layout
Bare bones notes.
Introduction to HTML5.
PPT By:Gaurav Jaiswal Singsys Pte. Ltd.
XHTML Basics.
Web Browsers & Mobile Web Browsers.
Tutorial 6 Topic: jQuery and jQuery Mobile Li Xu
Web Standards Web Design – Sec 2-3
PAGE LAYOUT - 1.  Most HTML elements are defined as block level elements or inline elements.  Block level elements normally start (and end) with a new.
Playing Audio (Part 2).
Introduction to HTML5.
Playing Audio (Part 1).
XHTML Basics.
XHTML Basics.
The Canvas.
New Form Input Types.
Bare bones notes.
SEEM4570 Tutorial 5: jQuery + jQuery Mobile
XHTML Basics.
New Semantic Elements (Part 3)
Introduction to Web Application Design
Introduction to HTML5.
XHTML Basics.
Creating a Basic Web Page using HTML
Concepts for fluid layout
And Mobile Web Browsers
WJEC GCSE Computer Science
Introduction to HTML5.
And Mobile Web Browsers
Web Programming and Design
Various mobile devices
Presentation transcript:

Browser Support for HTML5

Viewing HTML5 in Web Browsers In previous lessons, we learned about new elements in HTML5 and how to use them. Our assumption was that all our visitors could view our pages as we intend them, no matter which web browser and version they might be using. The reality is that browser compatibility with HTML5 is a complicated issue. As the specifications for HTML5 have not been finalized yet, and the formal adoption timeline continues to change, web browser manufacturers choose to accommodate new HTML5 features on their own timelines. To us as web designers, this means that some of our visitors will see our web pages as we intended, but others might see messy or "broken" pages.

Example of Older Browser Here is the page we created earlier, rendered by two different browsers: Firefox 19.0 Internet Explorer 8.0 The IE8 browser does not recognize the new HTML5 semantic elements and so it will not apply any CSS styling to those elements, making our page a mess.

Current Status of Browser Support So how do we know which browsers support HTML5? One way is to visit the caniuse.com website and to click on the feature we are interested in. From this chart, we see that all current browser versions support the new semantic elements, with the exeption of Opera Mini, which offers just partial support. Future versions and their expected level of support are shown in the faded boxes below the current versions. The site estimates the percentage of global users whose current browser supports the target feature. In this case, about 89% of the world's users will see our page as intended.

Planning for Older Browsers Microsoft's Internet Explorer (IE) unfortunately has the slowest adoption rate of HTML5 features. This is a headache to web designers, but a reality that must be accommodated. The HTML5 elements we covered thus far (i.e. semantic elements) are among the best adopted by today's browsers. As we continue in this course, other features we learn will have lower support rates. The good news is that there are several strategies we can employ to improve the user experience for those visitors with older browsers. We will discuss some of these "workarounds" and "fallbacks" in this lesson and also as we introduce other HTML5 features in the future.

CSS Display Property We have not yet covered the display property in CSS. It controls the way an element is displayed on the page. There are numerous possible settings, but these three are the most important: display: inline [no line breaks before or after the element] display: block [automatically apply line breaks before and after the element] display: none [hides the element from showing on the page] Some elements - such as <p>, <h1>, and <div> - are known as block-level elements, as they have line breaks by default. Other elements - such as <a> and <span> - are called inline elements and do not add line breaks by default. Older browsers that do not recognize the new HTML5 elements assume they are all inline elements, causing them to display all jumbled together. We can fix this issue by adding a single line of CSS to our website.

Workaround: Using CSS Let's add the following line to our CSS styling document: article, aside, figcaption, figure, footer, header, hgroup, nav, section { display: block; } By placing this line in the CSS files for all of our HTML5 sites, older browsers versions of Firefox, Chrome, Opera, and Safari will now treat the new semantic elements as block elements, preventing the page from displaying as a jumble on the screen. Newer browsers that recognize and support HTML5 elements will not be affected by this CSS line, as they already treat these as block elements. Unfortunately, this workaround alone will not suffice for Internet Explorer versions 8.0 and earlier. These earlier versions of IE refuse to apply any CSS styling at all to unrecognized elements. To accommodate those versions of IE, we will need to bring out a bigger weapon: JavaScript.

Workaround: Using JavaScript JavaScript is a programming language created specifically to run on web browsers. It provides web designers with a powerful way to perform advanced tasks beyond the capability of regular HTML and CSS. Learning how to program in JavaScript is beyond the scope of this course, but we'll take a quick look at some JavaScript code here: <script> document.createElement('article'); document.createElement('aside'); document.createElement('figcaption'); document.createElement('figure'); document.createElement('footer'); document.createElement('header'); document.createElement('hgroup'); document.createElement('nav'); document.createElement('section'); </script> JavaScript is placed between opening and closing <script> tags. Scripts can be placed almost anywhere in the web document but are most commonly placed in the <head> section. The JavaScript code in this example is telling the web browser to recognize the new HTML5 semantic elements as valid elements, thus allowing them to be styled via CSS. Whenever we add JavaScript to a web page, we must be mindful that a certain number of web visitors (approximately 2%) will either have JavaScript disabled or be on a device that does not support it.

JavaScript Shortcut Instead of adding the previous lines to each of our documents, we can take a shortcut by loading a free script directly from Google: <head> <title>Book Reviews</title> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> ... </head> By adding this single line to our web pages, IE 8.0 will now recognize all new HTML5 elements and will allow CSS styling to be applied. The Google script above defines many more HTML5 elements, not just the ones we have covered thus far. An additional advantage of using the script is that it will run only if an older browser version is detected. Internet Explorer 8.0 with JavaScript workaround

Browser Support Strategy If we include mobile browsers (such as those used in Apple and Android phones and tablets), at least a dozen major browsers are in current use. Each major browser has multiple versions in its history, and HTML5 support varies widely by both browser and version. As web designers, it is our responsibility to ensure that our pages are viewable in a reasonably acceptable format to the vast majority of visitors, regardless of which browser and version they might be using. To accomplish this and still use HTML5 in our pages, we use two types of strategies: Workarounds: additional coding (such as that used in this lesson) to "trick" older browsers into displaying our page the same way an updated browser would display it. Fallbacks: in the event that no workaround is possible, we can deliver alternate content to those with non-compliant browsers. We will see examples of this later in the course.