Widely available すべての主要ブラウザで対応済み。安心して使用可能。

対応ブラウザ

機能 デスクトップ モバイル
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
1
12
1
≤4
18
≤3.2
DOM API

HTMLElement.lang プロパティは、要素の属性値とテキストコンテンツの基本言語を取得または設定します。

1
12
1
3
18
1
1+対応 (バージョン) 未対応 注釈あり サブ機能の解説は MDN Web Docs (CC BY-SA 2.5)

基本構文

HTML
<html lang="ja">
<body>
  <p>Japanese text</p>
  <p lang="en">This is English text.</p>
  <blockquote lang="fr">C'est la vie.</blockquote>
</body>
</html>

ライブデモ

Mixed-language article

Declare the language of each fragment so pronunciation and styling stay accurate.

プレビュー全画面表示

Language-aware labels

Style labels differently with :lang() while keeping the source text intact.

プレビュー全画面表示

Quoted names and terms

Use nested lang values for titles, names, and quoted content inside a card.

プレビュー全画面表示

実務での使いどころ

  • lang の活用

    lang グローバル属性は、要素の言語を定義するために使用します。

注意点

  • 古いブラウザでは対応していない場合がある。

アクセシビリティ

  • スクリーンリーダーでの読み上げを確認すること。