DEV Community

Ranjani R
Ranjani R

Posted on

DAY 6

Hello! Today I learnt about HTML Media which includes audio video and images. I used to think that img tag was the only way to add images to a website....turns out I was wrong. Today I learnt about a new tag called picture which enables us to set different images for different screen sizes and screen orientations using the source tag which has the attribute media to specify the screen width or orientation. This tag also has type attribute to specify the image format so that browsers can render it accordingly. We can also have multiple source tags inside a picture tag . Also we need to definitely mention a img tag at the end of the last source tag which will be the default image displayed in case none of the conditions in the media attribute are met.
In order to attach video we have the video tag in HTML which also uses the source tag and the src attribute in order to specify the video location. I have yet to learn fully about this tag and so more about this tag in the next post. Overall a very interesting class today. Looking forward for tomorrow's class. See you all in the next post!

Top comments (0)