HTML <source> ประเภทแอตทริบิวต์
ตัวอย่าง
การใช้แอตทริบิวต์ประเภท:
<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
ความหมายและการใช้งาน
แอตทริบิวต์type
ระบุประเภทสื่ออินเทอร์เน็ต (เดิมเรียกว่าประเภท MIME) ของทรัพยากรสื่อ
รองรับเบราว์เซอร์
ตัวเลขในตารางระบุเบราว์เซอร์รุ่นแรกที่สนับสนุนแอตทริบิวต์อย่างเต็มที่
Attribute | |||||
---|---|---|---|---|---|
type | 4.0 | 9.0 | 3.5 | 4.0 | 10.5 |
ไวยากรณ์
<source type="media_type">
ค่าแอตทริบิวต์
Value | Description |
---|---|
media_type | Specifies the Internet media type of the media resource. Common media types: For video:
|
❮ แท็ก HTML <source>