VOOZH about

URL: https://www.geeksforgeeks.org/html/html-source-src-attribute/

⇱ HTML | <source> src Attribute - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML | <source> src Attribute

Last Updated : 19 Jul, 2022

The HTML <source> src attribute is used to specify the URL of the media resource. The source element is used as a child element of the <audio> and <video> element. 

Syntax: 

<source src="URL">

Attribute Values: It contains single value URL which specifies the URL of the media resource. There are two types of URL link which are listed below:

  • Absolute URL: It points to another webpage.
  • Relative URL: It points to other files of the same web page.

Below example illustrates the <source> src attribute in HTML: 

Example: 

Output:

 👁 Image
 

Supported Browsers: The browser supported by HTML <source> src attribute are listed below:

  • Google Chrome 
  • Edge 12
  • Internet Explorer 9.0
  • Firefox 3.5
  • Safari 
  • Opera 
Comment
Article Tags: