<!DOCTYPE html>
<div class="header">
you can simply write <header>
.<nav>
) is, and where the content of the page itself ( <article>
) is and when it has been updated ( <time pubdate datetime="…">
).<header>
is a block with navigation or introduction. For example, the top of the site.<nav>
- navigation. For example, the site menu.<aside>
is secondary information that is often placed in side panels.<article>
is an independent piece of content. For example, the text of the article or a separate comment.<section>
- the document section.<footer>
- “basement”, where copyright is often written, etc.<figure>
- caption to the picture or video.<hgroup>
is a header block, for example, when a heading consists of a main heading and a subtitle.<mark>
- the selection of a word, for example, matching the search query.<output>
- output of the program or the results of calculations.<time datetime="…" pubdate>
- time. The datetime
specified in a format that is convenient for the machine. If the pubdate property is set (SGML enemies can write pubdate="pubdate"
), then the specified time is the time the document was created or the nearest <article>
.rel
values, and <input>
types that can be used today, but this is better read on the W3C website or in other articles.document.createElement('article')
, then IE starts to see the new tag.innerHTML
that jQuery likes to use. But this problem is managed with the help of JS-manipulations.<strong>
). We don’t really need them, but it doesn’t hurt to make the necessary elements block in CSS:aside, nav, footer, header, section { display: block }
<head>
(before any new tags):<! - [if IE]> <script src = "http://html5shiv.googlecode.com/svn/trunk/html5.js"> </ script> <! [endif] ->
innerHTML
solution is already in the form of a compact JS script . Download it, connect to your site, and wrap all the HTML you add with the innerShiv(html5)
function innerShiv(html5)
.$('#example').append( innerShiv ("<section><header>jQuery</header></section>"))
var s = document.createElement('section');
s.appendChild( innerShiv ("<header><Plain JS</header>"));
document.getElementById('example').appendChild(s);
$(html5).appendTo('#example')
, you need to innerShiv
second argument to the innerShiv
so that it returns the result in the format you need for jQuery:$(innerShiv(html5, false)).appendTo('#example')
$5
, at the same time removing the extra code for normal browsers:if (jQuery.browser.msie) { window. $ 5 = function (html5) { return jQuery (innerShiv (html5, false)) } } else { window. $ 5 = function (html5) { return jQuery (html5) } }
$5(html5).appendTo('#example')
Source: https://habr.com/ru/post/90384/
All Articles