그림 요소 isn't supported in any browsers yet, 그것은 여전히 유일한 제안입니다. 브라우저가 <picture>
을 지원하지 않을 때마다 해당 대체 브라우저를 방문 할 것이므로 Chromium build that supports it 또는 무엇인가 있다면 유일한 시간은 아닙니다.
JS 폴리필을 사용하는 데 문제가없는 경우 <picture>
이 구현할 수있는 방식으로 반응 형 이미지를 계속 사용할 수 있습니다. Responsive Images 커뮤니티 그룹의 구성원 중 하나 인 Scott Jehl이 <picture>
을 밀어 내며 picturefill이라고 썼습니다.
코드를 약간 다르게 작성해야합니다. HTML 태그를 사용하는 대신 데이터 속성을 사용합니다. picturefill 워드 프로세서에서 예 :
<span data-picture data-alt="A giant stone face at The Bayon temple in Angkor Thom, Cambodia">
<span data-src="small.jpg"></span>
<span data-src="medium.jpg" data-media="(min-width: 400px)"></span>
<span data-src="large.jpg" data-media="(min-width: 800px)"></span>
<span data-src="extralarge.jpg" data-media="(min-width: 1000px)"></span>
<!-- Fallback content for non-JS browsers. Same img src as the initial, unqualified source element. -->
<noscript>
<img src="external/imgs/small.jpg" alt="A giant stone face at The Bayon temple in Angkor Thom, Cambodia">
</noscript>
</span>
주로 'picture' 태그가 HTML5의 일부가 아니기 때문입니다. 그것은 제안입니다. 지금까지 내가 아는 한, 어떤 브라우저도 현재 구현하지 않습니다. –
아, 좋아. 방금이 기사에서 읽었습니다. (http://mobile.smashingmagazine.com/2013/05/10/how-to-avoid-duplicate-downloads-in-responsive-images/) Thx. – alexP