PNG supports transparency and lossless compression, making it ideal for sharp images with transparent parts.
JPEG does not support transparency and uses lossy compression.
GIF supports transparency but is limited to 256 colors, so not ideal for photos.
BMP is uncompressed and large in size.
<audio src="song.mp3" controls></audio>
The <audio> tag is used to embed audio files. The src attribute specifies the file, and controls adds play/pause buttons.
Other tags like <sound> or <media> do not exist in HTML5.
href is not valid for <audio>.
<video width="320" height="240" controls> <source src="movie.webm" type="video/webm"> <source src="movie.mp4" type="video/mp4"> Your browser does not support the video tag. </video>
What will the user see if their browser supports MP4 but not WebM?
The browser tries the <source> elements in order. If it does not support the first format (WebM), it moves to the next (MP4).
Since the browser supports MP4, it will play that video.
The fallback text only shows if no sources are supported.
<video> tags that have the controls attribute. Which CSS selector is correct?video[controls] selects all <video> elements with a controls attribute.
video.controls selects videos with class 'controls'.
video#controls selects video with id 'controls'.
video > controls looks for child elements named 'controls', which is invalid.
The alt attribute provides descriptive text for screen readers.
Option D has no description, so screen readers skip it or read the file name.
Option D hides the image from screen readers.
Option D shows a tooltip but does not help screen readers.