Publish in HTML Tutorial el 25/05/2025 16:19
The <source> element is used to specify multiple media resources for media elements like <audio>, <video>, and <picture>. It allows you to provide alternative media formats for better browser compatibility and responsive design.
Key attributes of <source>:
This example shows how to provide fallback video formats using <source>. The browser will try each source in order until it finds a format it supports.
The <source> element can be used with <picture> to serve different images based on viewport size or device capabilities.
Similar to video, you can provide multiple audio formats for better browser compatibility.
This example demonstrates how to change the video source dynamically using JavaScript.
This example shows how to detect which media formats are supported by the browser.
type
attribute to help browsers determine if they can play the media without downloading it firstsrcset
attribute for resolution switching with responsive imagesThe <style> HTML element contains style information for a document, or part of a document. ...
The <strong> element is used to indicate that its content has strong importance, seriousnes...
The <span> element is an inline container used to mark up a part of a text or document. Unl...
The <small> element is used to represent side-comments and small print, typically for discl...
HTML <section> Element: The Complete Guide The <section> element is a semantic HTML ...
The <script> HTML element is used to embed or reference executable code, typically JavaScri...