HTML5では、カテゴリー・コンテンツモデルという概念が追加されました。
各要素はいずれかのカテゴリーに属しています(複数のカテゴリーに属す場合がほとんどです)。
そして、コンテンツモデルとはどのカテゴリーおよび要素を入れて良いかが定義されています。
下記サイトにて調べることが可能です。
https://html.spec.whatwg.org/multipage/
ですが、簡易的に調べられるようにちょっとしたツールを作成しました。
気になった時にさっと使おうかと作成したものです。
カテゴリー、コンテンツモデルは上記サイトを確認しながら、設定しています。
どの要素を入れられるか調べる
入力ミス等による誤り等がある場合があります。ご了承ください。
あくまで参考程度にご利用いただければと思います。
また、簡易的な
タグ・カテゴリー・コンテンツモデル一覧
上記ツールは下記表のデータを元に処理しています。
たまに確認し、更新していく予定ですが、入力ミス、誤り等ある場合もあります。ご了承ください。
※カテゴリーの「content」は省略しています
※2018年11月21日時点
| タグ | カテゴリー | コンテンツモデル |
|---|---|---|
| html | - | head(最初の要素)/body(headの次) |
| head | - | base/link/meta/noscript/script/style/template/title |
| title | Metadata | スペースではないテキスト |
| base | Metadata | - |
| link | Metadata | - |
| ※Flow content、Phrasing contentの場合、body内でも使用可能 | ||
| meta | Metadata/Flow(itemprop属性が存在する場合)/Phrasing(itemprop属性が存在しない場合) | - |
| style | Metadata | スタイルを設定できるテキスト(CSSならOKということかと) |
| body | Sectioning-root | Flow |
| article | Flow/Sectioning/Palpable | Flow |
| section | Flow/Sectioning/Palpable | Flow |
| nav | Flow/Sectioning/Palpable | Flow |
| aside | Flow/Sectioning/Palpable | Flow |
| h1-h6 | Flow/Heading/Palpable | Phrasing |
| hgroup | Flow/Heading/Palpable | h1-h6(h1-h6のいずれかを1つ以上)/script/template |
| header | Flow/Palpable | Flow(子孫にheader、footerは不可) |
| footer | Flow/Palpable | Flow(子孫にheader、footerは不可) |
| address | Flow/Palpable | Flow(heading content、sectioning content、子孫にheader、footer、addressは不可) |
| p | Flow/Palpable | Phrasing |
| pre | Flow/Palpable | Phrasing |
| blockquote | Flow/Sectioning-root/Palpable | Flow |
| ol | Flow/Palpable(子に一つでもli要素を含む場合) | li/script/template |
| ul | Flow/Palpable(子に一つでもli要素を含む場合) | li/script/template |
| menu | Flow/Palpable(子に一つでもli要素を含む場合) | li/script/template |
| li | - | Flow |
| dl | Flow/Palpable(子に一つでも名前、値のグループを含む場合) | dt/dl/script/template/div() |
| dt | - | Flow(header、footer、heading content、sectioning contentは不可) |
| dd | - | Flow |
| figure | Flow/Sectioning-root/Palpable | Flow/figcaption() |
| figcaption | - | Flow |
| main | Flow/Palpable | Flow |
| div | Flow/Palpable | dt(dl要素の子の場合)/dd(dl要素の子の場合)/script(dl要素の子の場合)/template(dl要素の子の場合)/Flow(dl要素の子ではない場合) |
| a | Flow/Phrasing/Interactive(要素がhref属性を持つ場合)/Palpable | Transparent(Interactive、子孫にa要素は不可) |
| em | Flow/Phrasing/Palpable | Phrasing |
| strong | Flow/Phrasing/Palpable | Phrasing |
| small | Flow/Phrasing/Palpable | Phrasing |
| s | Flow/Phrasing/Palpable | Phrasing |
| cite | Flow/Phrasing/Palpable | Phrasing |
| q | Flow/Phrasing/Palpable | Phrasing |
| dfn | Flow/Phrasing/Palpable | Phrasing(dfnは不可) |
| abbr | Flow/Phrasing/Palpable | Phrasing |
| ruby | Flow/Phrasing/Palpable | Phrasing(rubyは子孫ともに不可)/ruby(単一のみ可)/rt(1つ以上)/rp(1つ以上のrtが続くrpでそれぞれがrpに続く) |
| rt | - | Phrasing |
| rp | - | テキスト |
| data | Flow/Phrasing/Palpable | Phrasing |
| time | Flow/Phrasing/Palpable | Phrasing(datetime属性をもつ場合)/テキスト(決められた形式がある) |
| code | Flow/Phrasing/Palpable | Phrasing |
| var | Flow/Phrasing/Palpable | Phrasing |
| samp | Flow/Phrasing/Palpable | Phrasing |
| kbd | Flow/Phrasing/Palpable | Phrasing |
| sub | Flow/Phrasing/Palpable | Phrasing |
| sup | Flow/Phrasing/Palpable | Phrasing |
| i | Flow/Phrasing/Palpable | Phrasing |
| b | Flow/Phrasing/Palpable | Phrasing |
| u | Flow/Phrasing/Palpable | Phrasing |
| mark | Flow/Phrasing/Palpable | Phrasing |
| bdi | Flow/Phrasing/Palpable | Phrasing |
| bdo | Flow/Phrasing/Palpable | Phrasing |
| span | Flow/Phrasing/Palpable | Phrasing |
| br | Flow/Phrasing/Palpable | Phrasing |
| wbr | Flow/Phrasing | - |
| ins | Flow/Phrasing/Palpable | Transparent |
| del | Flow/Phrasing | Transparent |
| picture | Flow/Phrasing/Embedded | source/img(sourceの次にくる)/script/template |
| source | - | - |
| img | Flow/Phrasing/Embedded/Form-associated-element/Interactive(usemap属性を持つ場合)/Palpable | - |
| iframe | Flow/Phrasing/Embedded/Interactive/Palpable | - |
| embed | Flow/Phrasing/Embedded/Interactive/Palpable | - |
| object | Flow/Phrasing/Embedded/Interactive(usemap属性を持つ場合)/Listed/submittable/form-associated element/Palpable | param/transparent |
| param | - | - |
| video | Flow/Phrasing/Embedded/Interactive(controls属性を持つ場合)/Palpable | track(src属性を持つ場合。次にtransparent、ただし子孫にmediaは不可)/source(src属性を持たない場合。次にtrack、その次にtransparent、ただし子孫にmediaは不可) |
| audio | Flow/Phrasing/Embedded/Interactive(controls属性を持つ場合)/Palpable(controls属性を持つ場合) | track(src属性を持つ場合。次にtransparent、ただし子孫にmediaは不可)/source(src属性を持たない場合。次にtrack、その次にtransparent、ただし子孫にmediaは不可) |
| track | - | - |
| map | Flow/Phrasing/Palpable | Transparent |
| area | Flow/Phrasing | - |
| table | Flow/Palpable | caption/colgroup(caption以降)/thead(colgroup以降)/tbody(thead以降)/tr(thead以降)/tfoot(tbody、tr以降)/script/template |
| caption | - | Flow(子孫にtableは不可) |
| colgroup | - | -(span属性が存在する場合)/col(span属性が存在しない場合)/template(span属性が存在しない場合) |
| col | - | - |
| tbody | - | tr(1つ以上)/script/template |
| thead | - | tr(1つ以上)/script/template |
| tfoot | - | tr(1つ以上)/script/template |
| tr | - | td(td、th1つ以上)/th(td、th1つ以上)/script/template |
| td | Sectioning-root | Flow |
| th | - | Flow(子孫にheader,footer,sectioning content,heading contentは不可) |
| form | Flow/Palpable | Flow(子孫にformは不可) |
| label | Flow/Phrasing/Interactive/Palpable | Phrasing() |
| input | Flow/Phrasing/Interactive(type属性がhiddenではない場合)/Listed/labelable(type属性がhiddenではない場合)/submittable/resettable/autocapitalize-inheriting form-associated element/Palpable(type属性がhiddenではない場合) | - |
| button | Flow/Phrasing/Interactive/Listed/labelable/submittable/autocapitalize-inheriting form-associated element/Palpable | Phrasing(子孫にInteractive contentは不可) |
| select | Flow/Phrasing/Interactive/Listed/labelable/submittable/resettable/autocapitalize-inheriting form-associated element/Palpable | option/optgroup/script/template |
| datalist | Flow/Phrasing | Phrasing(またはoption)/option(またはPhrasing)/script/template |
| datalist | Flow/Phrasing | Phrasing(またはoption)/option(またはPhrasing)/script/template |
| optgroup | - | option/script/template |
| textarea | Flow/Phrasing/Interactive/Listed/labelable/submittable/resettable/autocapitalize-inheriting form-associated element/Palpable | テキスト |
| output | Flow/Phrasing/Listed/labelable/resettable/autocapitalize-inheriting form-associated element/Palpable | Phrasing |
| progress | Flow/Phrasing/Labelable element/Palpable | Phrasing(子孫にprogressは不可) |
| meter | Flow/Phrasing/Labelable element/Palpable | Phrasing(子孫にmeterは不可) |
| fieldset | Flow/Sectioning-root/Listed/autocapitalize-inheriting form-associated element/Palpable | legend(Flow contentに続く) |
| legend | - | Phrasing |
| details | Flow/Sectioning-root/Interactive/Palpable | summary/Flow(summaryに続く) |
| summary | - | Phrasing(またはheading)/heading(1つの要素。またはPhrasing) |
| dialog | Flow/Sectioning-root | Flow |
| script | Metadata/Flow/Phrasing/Script-supporting-element | ・・・ |
| noscript | Metadata/Flow/Phrasing | ・・・ |
| template | Metadata/Flow/Phrasing/Script-supporting-element | - |
| slot | Flow/Phrasing | Transparent |
| canvas | Flow/Phrasing/Embedded/Palpable | Transparent() |
スポンサーリンク



