WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

HTML5 Browser Support


You can show more seasoned programs to deal with HTML5 correctly.


HTML5 Browser Support

HTML5 is bolstered in all cutting edge browsers.

In expansion, all programs, old and new, consequently handle unrecognized components as inline elements.

Because of this, you can "teach" more established programs to deal with "unknown" HTML elements.


Define HTML5 Elements as Block Elements

HTML5 characterizes eight new semantic HTML components. All these are block-level elements.

To secure right conduct in more established programs, you can set the CSS display property to block:

header, segment, footer, aside, nav, principle, article, figure {
    show: square;
}

Adding New Elements to HTML

You can likewise add any new component to HTML with a program trick.

This model includes another component called <myHero> to HTML, and characterizes a show style for it:

Example

<!DOCTYPE html>
<html>
<head>
  <title>Creating a HTML Element</title>
  <script>document.createElement("myHero")</script>
  <style>
  myHero {
      show: block;
      foundation shading: #ddd;
      cushioning: 50px;
      text dimension: 30px;
  }
  </style>
</head>
<body>

<h1>My First Heading</h1>

<p>My first paragraph.</p>

<myHero>My First Hero</myHero>

</body>
</html>
Try it Yourself »

The JavaScript explanation document.createElement("myHero") is included, just to fulfill IE.


Thankfully, Sjoerd Visscher made the "HTML5 Enabling JavaScript", "the shiv":

<!- - [if lt IE 9]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]- - >

The code above is a remark, however forms past to IE9 will peruse it (and comprehend it).


The Complete Shiv Solution

Example

<!DOCTYPE html>
<html>
<head>
  <title>Styling HTML5</title>
  <!- - [if lt IE 9]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  <![endif]- - >
</head>
<body>

<h1>My First Article</h1>

<article>
Mahata Gandhi was conceived in 2 October 1869 Porbander,India.He was the pioneer of the Indian autonomy development against British rule.
</article>

</body>
</html>
Try it Yourself »

The connection to the shiv code must be set in the <head> component, since Internet Pioneer has to think about every single new component previously perusing them.


An HTML5 Skeleton

Example

<!DOCTYPE html>
<html lang="en">
<head>
<title>HTML5 Skeleton</title>
<meta charset="utf-8">

<!- - [if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js">
</script>
<![endif]- - >

<style>
body {font-family: Verdana, sans-serif; textual style size:0.8em;}
header,nav, section,article,footer
{border:1px strong dim; margin:5px; padding:8px;}
nav ul {margin:0; padding:0;}
nav ul li {display:inline; margin:5px;}
</style>
</head>
<body>

<header>
  <h1>HTML5 SKeleton</h1>
</header>

<nav>
<ul>
  <li><a href="html5_semantic_elements.asp">HTML5 Semantic</a></li>
  <li><a href="html5_geolocation.asp">HTML5 Geolocation</a></li>
  <li><a href="html5_canvas.asp">HTML5 Graphics</a></li>
</ul>
</nav>

<section>

<h1>Famous leader</h1>

<article>
<h2>Mahata Gandhi</h2>
<p>Mahata Gandhi was conceived in 2 October 1869 Porbander,India.He was the pioneer of the Indian autonomy development against British rule.</p>
</article>

<article>
<h2>George Washington</h2>
<p>>George Washington was conceived in 22 February 1732.He was the principal President of the USA from 1789 to 1797.</p>
</article>

<article>
<h2>George Washington</h2>
<p>>George Washington was conceived in 22 February 1732.He was the main President of the USA from 1789 to 1797.,
.</p>
</article>

</section>

<footer>
<p>&copy; 2019 . All rights reserved.</p>
</footer>

</body>
</html>
Try it Yourself »