
HTML5 Browser Support
HTML5 Browser Support
You can teach older browsers to handle HTML5 correctly.
HTML5 Browser Support
HTML5 is supported in all modern browsers.
Because of this, you can "teach" older browsers to handle "unknown" HTML elements.
In addition, all browsers, old and new, automatically handle unrecognized elements as inline elements.
You can even teach IE6 (Windows XP 2001) how to handle unknown HTML elements.
Define Semantic Elements as Block Elements
HTML5 defines eight new semantic elements. All these are block-level elements.
The JavaScript statement document.createElement("myHero")is needed to create a new element in IE 9, and earlier.
Problem With Internet Explorer 8
You could use the solution described above for all new HTML5 elements.
However, IE8 (and earlier) does not allow styling of unknown elements!
Thankfully, Sjoerd Visscher created the HTML5Shiv! The HTML5Shiv is a JavaScript workaround to enable styling of HTML5 elements in versions of Internet Explorer prior to version 9.
You will require the HTML5shiv to provide compatibility for IE Browsers older than IE 9.
Syntax For HTML5Shiv
The HTML5Shiv is placed within the <head>tag.
The HTML5Shiv is a javascript file that is referenced in a <script&>gt; tag.
To secure correct behavior in older browsers, you can set the CSS display property for these HTML elements to block:
header, section, footer, aside, nav, main, article, figure {
display: block;
}
Add New Elements to HTML
You can also add new elements to an HTML page with a browser trick.
This example adds a new element called <myHero&>gt; to an HTML page, and defines a style for it>
<Example<!DOCTYPE html>
<html>
<head>
<script>document.createElement("myHero")</script>
<style>
myHero {
display: block;
background-color:#dddddd;
padding: 50px;
font-size: 30px;
}
</style>
</head>
<<body&g>;
<>;<h1>A Heading</h1>
<myHero>My Hero Element</myHero>
</body>
</html>
Leave HTML5 Browser Support to:
Read more #html5 posts
Best Posts From Md Robiul Islam
We have not curated any of rabiul21's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Md Robiul Islam
- ABOUT BANGLADESH
- Why Study JavaScript?
- Nice Doll
- Photography
- HTML5 Geolocation
- HTML Plug-ins
- HTML5 Audio
- HTML Multimedia
- HTML Multimedia
- HTML5 Canvas
- HTML5 Semantic Elements
- HTML5 New Elemen New
- HTML5 Browser Support
- HTML5 Introduction
- HTML Input Attributes
- HTML Form Elements
- HTML Forms
- HTML Symbol Entities
- HTML Entities
- HTML Computer Code Elements