常用的 MIME 型態如下表
| Adobe Flash | application/x-shockwave-flash |
| Atom feeds | application/atom+xml |
| CSS | text/css |
| DTD | application/xml-dtd |
| ECMAScript/JavaScript | application/ecmascript, application/javascript |
| GIF | image/gif |
| GoogleWebToolkit data | text/x-gwt-rpc |
| Gzip | application/x-gzip |
| HTML | text/html |
| ICO | image/vnd.microsoft.icon |
| JPEG | image/jpeg, image/pjpeg |
| jQuery template data | text/x-jquery-tmpl |
| LaTeX | application/x-latex |
| MP3, MPEG | audio/mpeg |
| MP4 | audio/mp4 |
| Ogg | application/ogg |
| application/pdf | |
| PNG | image/png |
| PostScript | application/postscript |
| QuickTime | video/quicktime |
| RAR | application/x-rar-compressed |
| RealAudio | audio/vnd.rn-realaudio |
| RSS feeds | application/rss+xml |
| SVG | image/svg+xml |
| Textual data | text/plain |
| TIFF | image/tiff |
| WAV | audio/vnd.wave |
| WebM | audio/webm |
| Web Open Font Format | application/font-woff |
| Windows Media Audio | audio/x-ms-wma, audio/x-ms-wax |
| Windows Media Video | video/x-ms-wmv |
| XHTML | application/xhtml+xml |
| XML | text/xml |
| ZIP | application/zip |
通常內嵌元素 (embedded content) 如 <object> 、 <embed> 需要設定 type 屬性 (attribute) ,該屬性值必須是有效的 MIME 型態,一旦設定 type 就得與指定來源檔案的 src 屬性相符,不然有可能導致瀏覽器 (broswer) 無法處理,例如
<!DOCTYPE html> <html> <head> <title>HTML 5 DEMO</title> <style> article { display: block; } </style> </head> <body> <section> <article> <embed type="text/plain" src="example.jpg"> </article> </section> </body> </html>
embed type is text....but the source is jpg file...... so it would result in error message
<embed type="image/jpeg" src="example.jpg">

沒有留言:
張貼留言