How to use source SRC?

Query By: HUSNUL ALTWAY

M

Madhuri Yadav

Definition of <source> HTML Tag

Basically, The <source> html tag is used to specify multiple media resources for media elements, like <video>, <audio>, and <picture>.

The <source> tag allows you to specify alternative video/audio/image files that the browser may choose from, based on its media type, codec support, or media query.


Definition of SRC attribute

When <source> is used in <audio><video>, and <picture> OR <img />. That time the SCR attribute required to specifies the URL of the media file.


Syntax Example Of <source> and SRC attribute

<source> tag is used in <audio> tag with SRC attribute


<audio controls>

  <source src="URL_audio" type="audio/ogg">

  <source src="URL_audio" type="audio/mpeg">

</audio>


SRC attribute is used in <img /> tag


<img src="Image_URL" alt="image description" title="image title description" />

0 votes

Your Answer

Email Us: advertise@gdatamart.com

Donate Us: Support to GDATAMART

LifeStyle & Fun

© 2024 GDATAMART.COM (All Rights Reserved)