Skip to content

Commit ea3770d

Browse files
committed
Fixes mdo#59: Document lang attribute
1 parent 89d26e7 commit ea3770d

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

_includes/html/lang.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<html lang="en-us">
2+
<!-- ... -->
3+
</html>

index.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ <h4><a href="#html">HTML</a></h4>
1212
<ul>
1313
<li><a href="#html-syntax">Syntax</a></li>
1414
<li><a href="#html-doctype">HTML5 doctype</a></li>
15+
<li><a href="#html-lang">Language attribute</a></li>
1516
<li><a href="#html-encoding">Character encoding</a></li>
1617
<li><a href="#html-style-script">CSS and JavaScript includes</a></li>
1718
<li><a href="#html-practicality">Practicality over purity</a></li>
@@ -84,6 +85,21 @@ <h3>HTML5 doctype</h3>
8485
</div>
8586
</div>
8687

88+
<div class="section" id="html-lang">
89+
<div class="col">
90+
<h3>Language attribute</h3>
91+
<p>From the HTML5 spec:</p>
92+
<blockquote>
93+
<p>Authors are encouraged to specify a lang attribute on the root html element, giving the document's language. This aids speech synthesis tools to determine what pronunciations to use, translation tools to determine what rules to use, and so forth.</p>
94+
</blockquote>
95+
<p>Read more about the <code>lang</code> attribute <a href="http://www.w3.org/html/wg/drafts/html/master/semantics.html#the-html-element">in the spec</a>.</p>
96+
<p>Head to Sitepoint for a <a href="http://reference.sitepoint.com/html/lang-codes">list of language codes</a>.</p>
97+
</div>
98+
<div class="col">
99+
{% highlight html %}{% include html/lang.html %}{% endhighlight %}
100+
</div>
101+
</div>
102+
87103
<div class="section" id="html-encoding">
88104
<div class="col">
89105
<h3>Character encoding</h3>

0 commit comments

Comments
 (0)