aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/html/global_attributes/style/index.html
blob: 1db7c5804b0cefbba4e1ced61793a43d834cb7fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
title: style
slug: Web/HTML/Global_attributes/style
tags:
  - HTML
  - Reference
  - グローバル属性
  - リファレンス
translation_of: Web/HTML/Global_attributes/style
---
<div>{{HTMLSidebar("Global_attributes")}}</div>

<p><code><strong>style</strong></code> <a href="/ja/docs/Web/HTML/Global_attributes">グローバル属性</a>は、要素に適用する <a href="/ja/docs/Web/CSS">CSS</a> スタイル宣言を包含します。なお、スタイルは別のファイルで定義することが推奨されます。この属性と {{HTMLElement("style")}} 要素の主な用途は、例えばテストのために、すばやくスタイルを適用できるようにすることです。</p>

<div>{{EmbedInteractiveExample("pages/tabbed/attribute-style.html","tabbed-shorter")}}</div>

<p class="hidden">このデモのソースファイルは GitHub リポジトリに格納されています。デモプロジェクトに協力したい場合は、 <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> をクローンしてプルリクエストを送信してください。</p>

<div class="note">
<p><strong>使用上のメモ:</strong> この属性は、意味的な情報を伝えるために使用してはいけません。すべてのスタイルが削除されたとしても、ページは依然として意味的にが正しくあるべきです。特に、無関係な情報を隠すために使用しないようにしてください。これには <a href="/ja/docs/Web/HTML/Global_attributes/hidden"><strong>hidden</strong></a> 属性を使用してください。</p>
</div>

<h2 id="Specifications" name="Specifications">仕様書</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">仕様書</th>
   <th scope="col">状態</th>
   <th scope="col">備考</th>
  </tr>
  <tr>
   <td>{{SpecName('HTML WHATWG', "dom.html#the-style-attribute", "style")}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td>最新のスナップショットである {{SpecName('HTML5.1')}} から変更なし。</td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5.1', "dom.html#the-style-attribute", "style")}}</td>
   <td>{{Spec2('HTML5.1')}}</td>
   <td>{{SpecName('HTML WHATWG')}} のスナップショットであり、 {{SpecName('HTML5 W3C')}} から変更なし。</td>
  </tr>
  <tr>
   <td>{{SpecName('HTML5 W3C', "dom.html#the-style-attribute", "style")}}</td>
   <td>{{Spec2('HTML5 W3C')}}</td>
   <td>{{SpecName('HTML WHATWG')}} のスナップショット。 {{SpecName("HTML4.01")}} から、真にグローバルな属性になりました。</td>
  </tr>
  <tr>
   <td>{{SpecName('HTML4.01', 'present/styles.html#h-14.2.2', 'style')}}</td>
   <td>{{Spec2('HTML4.01')}}</td>
   <td>{{HTMLElement("base")}}, {{HTMLElement("basefont")}}, {{HTMLElement("head")}}, {{HTMLElement("html")}}, {{HTMLElement("meta")}}, {{HTMLElement("param")}}, {{HTMLElement("script")}}, {{HTMLElement("style")}}, and {{HTMLElement("title")}} を除くすべての要素で対応。</td>
  </tr>
  <tr>
   <td>{{SpecName("CSS3 Style", "", "")}}</td>
   <td>{{Spec2("CSS3 Style")}}</td>
   <td><code>style</code> 属性の内容を定義。</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>

<p>{{Compat("html.global_attributes.style")}}</p>

<h2 id="See_also" name="See_also">関連情報</h2>

<ul>
 <li>すべての<a href="/ja/docs/Web/HTML/Global_attributes">グローバル属性</a></li>
</ul>