0
我使用html5shiv为HTML5元素启用样式。无法识别克隆的父元素中的IE8 HTML5元素
当我克隆具有HTML5元素子元素的非HTML5元素(并且只有非HTML5元素)时,该子元素无法被IE8识别。
在下面的示例中,第一部分是粉红色,而克隆版本不是。
<!doctype html>
<html>
<head>
<style>
div section { background:#f0f; display:block; }
</style>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script>
jQuery(function ($) {
$('#article').append($('div').clone());
});
</script>
</head>
<body>
<article id="article">
<div><section>This section should have a pink background.</section></div>
</article>
</body>
</html>
jsbin例如:http://jsbin.com/yuqeriwoxeqa/1/