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>