Att Source Src π
2026-06-14 | π HTML
## HTML `
` `src` Attribute
The `src` attribute of the `` tag specifies the URL of the media resource (such as an audio or video file) to be played.
When used inside `` or `` elements, the browser will look through the child `` elements and play the first one that it supports.
---
## Syntax
```html
```
### Attribute Values
| Value | Description |
| :--- | :--- |
| *URL* | The URL of the media file. **Possible values:** β’ **Absolute URL:** Points to another website (e.g., `src="https://www.example.com/media/horse.ogg"`) β’ **Relative URL:** Points to a file within the same website (e.g., `src="media/horse.ogg"`) |
---
## Code Examples
### Example 1: Audio Player with Multiple Formats
In this example, the audio player provides two different source formats. The browser will automatically select and play the first format it supports (either Ogg or MP3).
```html
Your browser does not support the audio element.
```
### Example 2: Video Player with Fallback Sources
Similarly, for video playback, you can specify multiple formats to ensure cross-browser compatibility.
```html
Your browser does not support the video tag.
```
---
## Browser Compatibility
The `src` attribute of the `` tag is widely supported across all modern web browsers:
* **Google Chrome:** Supported
* **Mozilla Firefox:** Supported
* **Microsoft Edge / Internet Explorer:** IE 9+ and Edge are supported (IE 8 and earlier versions do not support the `` tag)
* **Safari:** Supported
* **Opera:** Supported
---
## Key Considerations
* **HTML5 Standard:** The `` tag and its `src` attribute are new features introduced in HTML5. They do not exist in HTML 4.01.
* **The `type` Attribute:** When using the `src` attribute, it is highly recommended to also specify the `type` attribute (the MIME-type of the media). This allows the browser to quickly skip files it cannot play without having to download and buffer them first.
* **Order Matters:** Place the highest-quality or most widely supported formats first. The browser evaluates `` tags in the order they appear in the document and stops at the first compatible one.