English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Manual de referência HTML

大全 de etiquetas HTML

Propriedade src do HTML source

A propriedade src especifica o URL do arquivo de mídia a ser reproduzido, quando se usa <source> dentro de <audio> e <video>, essa propriedade é necessária.

 HTML <source> tag

Exemplo online

Player de áudio com dois arquivos de origem. O navegador deve escolher o arquivo que suporta os seguintes arquivos (se houver):

<áudio controls>
<source src="cavalo.ogg" tipo="áudio/ogg">
<source src="cavalo.mp3" tipo="áudio/mpeg">
Seu navegador não suporta o elemento de áudio.
</audio>
Test and see ‹/›

Browser compatibility

IEFirefoxOperaChromeSafari

Internet Explorer 9+Firefox, Opera, Chrome and Safari support the src attribute.

Note:Internet Explorer 8 and earlier versions do not support the <source> tag.

Definition and usage

The src attribute specifies the URL of the media file to be played.

This attribute is required when using <source> in <audio> and <video>.

HTML 4.01 and HTML5Differences between

<source> tag is HTML5 New tag in

Syntax

<source src="URL">

Attribute value

ValueDescription
URLSpecify the URL of the media file.
Possible values:
Absolute URL-Points to another website (for example href =“ http://www.example.com/horse.ogg”)
Relative URL-Points to a file within the website (for example href =“ horse.ogg”)
 HTML <source> tag