Friday, 6 September 2013

HTML5 "picture"-Tag doesn't work

HTML5 "picture"-Tag doesn't work

i've got a problem with the HTML5 picture-element. I would like to show a
smaller image for devices with a max-width of 600px. The other devices
should get the big picture.
<picture alt="logo">
<source src="img/b2b-logo-small.png" media="max-width: 600px">
<source src="img/b2b-logo.png" >
<img class="logo" src="img/b2b-logo.png" /> <!-- Fallback -->
</picture>
Nothing happens if i reduce the width of the browser window because Chrome
always shows the picture from the img-tag (Fallback). Why?

No comments:

Post a Comment