HTML src attribute Last Updated : 27 Mar, 2024 Comments Improve Suggest changes Like Article Like Report The HTML src attribute specifies the URL or file path of an external resource, such as an image, video, audio file, or script, to be embedded or referenced within a webpage. Syntax: <element src="url">HTML src attribute Supported tagsTagDescription<audio>Embeds sound content for playback in a webpage.<embed>Integrates external applications or content.<iframe>Embeds another HTML document within the current one.<frame>Deprecated. Divides the browser window.<img>Embed images for display.<input>Creates interactive control elements in forms.<script>Embeds or links to external scripts.<source>Specifies alternative media resources.<track>Provides text tracks for multimedia elements.<video>Embeds video content for playback in a webpage.Attribute ValuesIt contains a single value URL that specifies the link of the source file. There are two types of URL links which are listed below: TermDescriptionAbsolute URLPoints to a resource outside the current website/domain.Relative URLPoints to a resource within the same website/domain.Example of HTML src attributeExample 1: In this example we displays GeeksforGeeks heading and an audio player with multiple source files for playback control. html <!DOCTYPE html> <html> <head> <title> HTML audio src Attribute </title> </head> <body style="text-align:center;"> <h1 style="color:green"> 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 2: In this example image linked via the "src" attribute with an alternative text. html <!DOCTYPE html> <html> <head> <title> HTML img src Attribute </title> </head> <body> <h1 style="color:green"> GeeksforGeeks </h1> <h2>HTML img src Attribute</h2> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/20190506164011/logo3.png" alt="GeeksforGeeks logo"> </body> </html> Output:  Supported Browsers: The browsers supported by HTML src attribute are listed below: Google ChromeEdge FirefoxOperaSafari Comment More infoAdvertise with us Next Article HTML src attribute V Vijay Sirra Follow Improve Article Tags : Web Technologies HTML HTML-Attributes Similar Reads HTML | srcdoc Attribute The HTML srcdoc attribute is used to specify the HTML content of the page to show in the inline frame. This attribute is anticipated to be used beside the sandbox and seamless attributes. If a browser supports the srcdoc attribute, it'll override the content laid out in the src attribute (if present 1 min read HTML is Attribute The HTML is attribute global attribute allows a standard element to adopt behavior defined by a custom built-in element, but only after the custom element is defined.Syntax<tag is="word-count"></tag>Here, the tag could be any HTML tag.HTML is Attribute ExampleExample 1: In this example, 2 min read HTML | scoped Attribute The HTML scoped attribute is a boolean attribute that is used to specify that the styles only apply to this element's parent element and that element's child elements (not the entire document).Note : It is a deprecated attribute and it is not supported by HTML5. Supported tag: style Example: html 1 min read HTML Id Attribute HTML id attribute provides a unique identifier for an element within a document. It allows targeted selection and manipulation of the element through CSS and JavaScript, facilitating specific styling and functionality. In CSS, the id attribute is used using the # symbol followed by id. quotes are no 5 min read HTML list Attribute The HTML list attribute associates an input field with a datalist element, providing a predefined list of options for user selection.Usage: This attribute is used by the <input> element.Syntax: <input list="name">Where name is a string that will work as id and will be used to link the 3 min read HTML | wrap Attribute The wrap attribute is used to specify that in which manner the text is to be wrapped in a text area when a form is submitted. The wrap attribute can be applied on the <textarea> element: Supported Tags: <Textarea> Attribute Values: soft: This is a default value. It specifies that the Tex 1 min read HTML size Attribute The size attribute in HTML is used to specify the initial width for the input field and the number of visible rows for the select element.The size attribute can be used with the following elements:  <input><hr><select><font> Attribute Values: It contains a numeric value that 3 min read HTML | span Attribute The HTML span Attribute is used to define the number of column that a <col>, <colgroup> element should span. Applicable to: colcolgroup Syntax: < element span="number"> Attribute Values: It contains the numeric value which specifies the number of supported element should span. Exam 1 min read HTML Attributes HTML Attributes are special words used within the opening tag of an HTML element. They provide additional information about HTML elements. HTML attributes are used to configure and adjust the element's behavior, appearance, or functionality in a variety of ways. Each attribute has a name and a value 8 min read HTML style attribute The HTML style attribute allows CSS to be applied directly within HTML tags. This enables styling of an element without the need for an external CSS file or a <style> block. It provides a quick, inline way to apply styles to individual elements.Syntax<tagname style="property: value;"> Co 5 min read Like