HTML src attribute
The html src attribute is used to specify the location (URL) of the external resource.
Supported tags:
Example: HTML audio src attribute
<!DOCTYPE html> <html> <head> <title> HTML audio src Attribute </title> </head> <body style="text-align:center;"> <h1>GeeksforGeeks</h1> <h2> HTML audio src Attribute </h2> <audio controls muted> <source src="GFG.mp3" type="audio/mp3"> <source src="GFG.ogg" type="audio/ogg"> </audio> </body> </html> |
chevron_right
filter_none
Output:

Example: HTML img src Attribute
<!DOCTYPE html> <html> <head> <title> HTML img src Attribute </title> </head> <body> <h1>GeeksforGeeks</h1> <h2>HTML img src Attribute</h2> <img src= alt="GeeksforGeeks logo"> </body> </html> |
chevron_right
filter_none
Output:

Supported Browsers: The browsers supported by HTML src attribute are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Apple Safari
- Opera
Recommended Posts:
- HTML | <img> src Attribute
- HTML | value Attribute
- HTML | name Attribute
- HTML | low Attribute
- HTML | <bdo> dir Attribute
- HTML | alt attribute
- HTML | min Attribute
- HTML | <map> name Attribute
- HTML | rel attribute
- HTML | <li> value Attribute
- HTML | <a> rel Attribute
- HTML | dir Attribute
- HTML | <img> alt Attribute
- HTML | for Attribute
- HTML | max attribute
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




