Skip to content
Related Articles

Related Articles

HTML src attribute
  • Last Updated : 30 Sep, 2019
GeeksforGeeks - Summer Carnival Banner

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>                     

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

Output:

Supported Browsers: The browsers supported by HTML src attribute are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Apple Safari
  • Opera

full-stack-img

My Personal Notes arrow_drop_up
Recommended Articles
Page :