Articles → HTML → Picture Tag In Html
Picture Tag In Html
Purpose
Syntax
<picture><source media="(min-width:)" srcset=""><img src="” alt=" " /></picture>
Example
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<picture>
<source media="(min-width:650px)" srcset="http://gyansangrah.com/ArticleImages/basic_silverlight_example_one.jpg">
<source media="(min-width:465px)" srcset="http://gyansangrah.com/ArticleImages/svg_polygon_html5_one.jpg">
<img src="http://gyansangrah.com/ArticleImages/basic_silverlight_example_one.jpg" alt="" style="width:auto;">
</picture>
</body>
</html>
Try It
Output
Browser Support
Internet Explorer | Firefox | Chrome | Safari | Opera | Edge |
---|
13.0 | 38.0 | 38.0 | 9.1 | 25.0 | Yes |