Skip to content

Commit 77982e2

Browse files
committed
Normalize the template element display
The `template` element shipped in Firefox 22 and Chrome 26. Browsers without HTML template support should at least hide the element.
1 parent 37b483c commit 77982e2

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

normalize.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ audio:not([controls]) {
4444
}
4545

4646
/**
47-
* Address styling not present in IE 8/9.
47+
* Address `[hidden]` styling not present in IE 8/9.
48+
* Hide the `template` element in IE, Safari, and Firefox < 22.
4849
*/
4950

50-
[hidden] {
51+
[hidden],
52+
template {
5153
display: none;
5254
}
5355

test.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ <h1>Text-level semantics</h1>
9696
The <var>var element</var> example
9797
</p>
9898

99+
<h1>Template content</h1>
100+
<template>
101+
<h1>{{title}}</h2>
102+
<content></content>
103+
</template>
104+
99105
<h1>Embedded content</h1>
100106

101107
<h3>audio</h3>

0 commit comments

Comments
 (0)