HTML Media Elements multimedia content ko integrate karne ke liye use kiye jate hain, jaise audio, video, images, aur animations. Yeh elements user experience ko aur enhance karne me madad karte hain.
1. Audio & Video Elements
Example:
<audio controls>
<source src="sound.mp3" type="audio/mp3">
Your browser does not support the audio element.
</audio>
<video controls width="500">
<source src="video.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
2. Image Elements
Example:
<figure>
<img src="image.jpg" alt="A beautiful scenery">
<figcaption>Nature at its best.</figcaption>
</figure>
3. Scalable Vector Graphics (SVG)
Example:
<svg width="100" height="100">
<circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />
</svg>
4. Canvas Element (For Graphics & Animations)
Example:
<canvas id="myCanvas" width="200" height="100" style="border:1px solid #000;"></canvas>
<script>
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.fillStyle = "blue";
ctx.fillRect(20, 20, 150, 80);
</script>
5. Embed & Object Elements
Example:
<embed src="document.pdf" width="600" height="400">
Agar tumhe kisi specific media element ki aur detail chahiye ho to batao!