Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML source media attribute

HTML media Property

HTML source Tag Reference HTML tag

Example

Usage of the media attribute:

<

source

src

=

"

movie.ogg

"

type

=

"

video/ogg

"

media

=

"

screen and (min-width:320px)

"

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Almost all major browsers do not support the media attribute.


Definition and Usage

The media property specifies the type of media resource (what media/device the file is optimized for).

The browser uses this attribute to determine whether it can play the file. If it cannot, it may choose not to download the file.

**Note:** This property can accept multiple values.


Differences between HTML 4.01 and HTML5

The tag is new in HTML5.

Syntax

HTML tag