DEV Community

M Ramavel
M Ramavel

Posted on

HTML MEDIA

Hello!Today class html media on the web is image,sound, music, and videos, movies this media tag used in htmlTUDAY Class two topic learned picture and video

HTML picture Image

The <picture> element contains one or more <source> elements, each referring to different images through the srcset attribute. This way the browser can choose the image that best fits the current view and/or device.
Each <source>element has a media attribute that defines when the image is the most suitable.

Example

<picture>
<source media="(min-width: 650px)" srcset="food.jpg">
<source media="(min-width: 465px)" srcset="car.jpg">
<img src="girl.jpg">
</picture>

HTML Video

The HTML <video> element is used to show a video on a web page
first of video tag in html which also use source tag and** src** attribute in the order in video location and video types attribute.

Example

<video>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
</video>

we have learned how to add img,video and multiple image, how to add in HTML web page.

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.