HTML <style>タイプ属性
例
type属性を使用して、<style>タグのメディアタイプを指定します。
<style type="text/css">
h1 {color:red;}
p {color:blue;}
</style>
定義と使用法
この属性は、タグtype
のインターネットメディアタイプ(以前はMIMEタイプと呼ばれていました)を指定します。<style>
このtype
属性は、タグ
<style>
と</style>
タグの間のコンテンツを識別します。
デフォルト値は「text / css」で、コンテンツがCSSであることを示します。
ブラウザのサポート
Attribute | |||||
---|---|---|---|---|---|
type | Yes | Yes | Yes | Yes | Yes |
構文
<style type="media_type">
属性値
Value | Description |
---|---|
media_type | The Internet media type of the style sheet. For now, the only supported value is "text/css". Look at IANA Media Types for a complete list of standard media types |
❮HTML<style>タグ