HTML- Attribut vom Typ <style>
Beispiel
Verwenden Sie das type-Attribut, um den Medientyp des <style>-Tags anzugeben:
<style type="text/css">
h1 {color:red;}
p {color:blue;}
</style>
Definition und Verwendung
Das type
Attribut gibt den Internet-Medientyp (früher bekannt als MIME-Typ) des <style>
Tags an.
Das type
Attribut identifiziert den Inhalt zwischen den
Tags
<style>
und .</style>
Der Standardwert ist „text/css“, was anzeigt, dass der Inhalt CSS ist.
Browser-Unterstützung
Attribute | |||||
---|---|---|---|---|---|
type | Yes | Yes | Yes | Yes | Yes |
Syntax
<style type="media_type">
Attributwerte
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>-Tag