picture-element
하는 일
이 스킬은 프로젝트의 picture 요소를 검토하고, img 대체 요소가 없거나 핵심 속성이 빠진 것을 고칩니다. 최신 형식의 이미지를 제공하는 웹 제작자를 위한 것입니다.
사용하는 경우
- ✓프로젝트의 picture 요소에 대체 이미지가 빠졌는지 확인해 달라고 요청할 때.
- ✓일부 브라우저에서 이미지가 보이지 않고 마크업이 불완전할 수 있을 때.
- ✓최신 이미지 형식을 추가하면서 처음부터 마크업을 올바르게 하고 싶을 때.
스킬 링크
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/picture-element/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 사이트의 picture 요소를 확인하고, 대체 이미지나 alt 텍스트가 빠진 곳을 고쳐 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 각 picture 요소가 alt, width, height 속성을 가진 img 요소로 끝나는지 확인합니다. 또한 source 요소가 먼저 오고, srcset이나 media 값이 있으며, 형식 선택을 위한 type이 있는지 확인하고 빠진 부분을 추가합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Use <picture> with an <img> fallback
A <picture> without an <img> fallback renders nothing in browsers that don't support <picture> (IE11) or don't support any of the <source> formats. The <img> child is also where alt, width, height, loading, and fetchpriority attributes live—these apply regardless of which source the browser selects.
Quick Reference
- Every
<picture>must end with an<img>element—it is the required fallback and carriesalt <source>elements are evaluated top-to-bottom; the first match wins- Use
type="image/avif"andtype="image/webp"on<source>for format selection - The
<img src>should point to a JPEG or PNG—the universal fallback for all browsers
Check
Scan all <picture> elements in this codebase. Verify: 1) Every <picture> has an <img> as its last child (required fallback). 2) The <img> has an alt attribute. 3) The <img> has width and height attributes. 4) <source> elements appear before the <img> child. 5) Each <source> has either a srcset attribute or a media attribute. 6) format-selecting <source> elements have a type attribute (type="image/avif", type="image/webp"). Flag any <picture> missing an <img> child or with <img> not as the last child.
Fix
For each <picture> element with issues: 1) If missing <img>: add <img src="{fallback-url}" alt="{description}" width="{w}" height="{h}"> as the last child. 2) If <img> is not last: move it to after all <source> elements. 3) If <source> elements lack type attributes for format selection: add type="image/avif" or type="image/webp". 4) Verify the <img src> points to a universally supported format (JPEG or PNG) as the ultimate fallback. Show the corrected <picture> markup.
Explain
Explain how the <picture> element works. Browsers evaluate <source> elements in document order and use the first one whose conditions match (type, media, srcset). The <img> element is the fallback for browsers that don't support <picture> (IE11) or don't support the source format. Without an <img> child, <picture> is invalid HTML and produces no output. The alt attribute must be on the <img>, not the <source> elements—it applies regardless of which source is selected.
Code Review
Review image assets, markup, and delivery configuration related to Use <picture> with an <img> fallback. Flag exact files or components where format choice, sizing, or loading behavior violates the rule, and describe how to confirm the fix in DevTools.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/images/picture-element
자주 묻는 질문
img 대체 요소가 왜 중요한가요?
picture나 나열된 형식을 지원하지 않는 브라우저는 img 요소가 있어야 아무것이라도 보여 줄 수 있습니다.
source 요소는 어떻게 작동하나요?
스킬은 위에서 아래로 차례로 확인되며, 처음 맞는 것이 쓰인다고 설명합니다.
alt와 크기 속성은 어디에 두나요?
스킬은 img 요소에 두어야 하며, 그러면 어떤 source가 선택되든 적용된다고 설명합니다.
상세 정보
작성자의 원본 설명
Use when reviewing image assets, markup, and CDN or build transforms related to Use <picture> with an <img> fallback. Check encoded size, rendered size, loading strategy, and above-the-fold impact together.
인기도
- GitHub 스타
- 75k
- 순위
- #2979
- 라이선스
- MIT
- 업데이트
- 2026. 10. 31.
댓글
- …
이 저장소의 다른 스킬
frontendchecklist
75k명령줄 도구를 사용해 380개가 넘는 규칙으로 프런트엔드 코드와 실시간 페이지를 접근성, 속도, SEO, 보안 측면에서 점검합니다.
frontend-checklist-global
75kFront-End Checklist의 386개 규칙 전체로 프런트엔드 프로젝트를 감사하고, 발견한 문제마다 구체적인 해결 방법을 제시합니다.
404-page
75k없는 페이지 화면에 도움이 되는 링크가 있고 실제 404 상태 코드를 반환하는지 확인해, 길을 잃은 방문자를 돕습니다.
about-page
75k사이트를 운영하는 사람을 설명하는 명확한 소개 페이지가 있는지 검토해, 방문자와 검색 엔진의 신뢰를 높입니다.