AI로 만드는 HTML 구조
AI와 함께 시맨틱 HTML을 만들어요 — 페이지 구조, 폼, 내비게이션, 접근성, 모든 디바이스에서 작동하는 SEO 친화적 마크업.
프리미엄 강좌 콘텐츠
이 레슨은 프리미엄 강좌의 일부예요. Pro로 업그레이드하면 모든 프리미엄 강좌와 콘텐츠를 이용할 수 있어요.
- 모든 프리미엄 강좌 이용
- 1000개 이상의 AI 스킬 템플릿 포함
- 매주 새로운 콘텐츠 추가
시맨틱 HTML: 의미가 있는 구조
HTML은 화면에 무언가를 보여주는 것만이 아니에요 — 콘텐츠에 의미를 부여하는 거예요. AI는 요청하는 어떤 HTML이든 생성할 수 있지만, 품질은 구조를 얼마나 잘 설명하느냐에 달려 있어요.
페이지 뼈대
모든 웹 페이지는 같은 기초로 시작해요:
Create a semantic HTML5 page structure for a [type of page: landing page / blog post / portfolio / product page].
Include:
1. DOCTYPE and html lang attribute
2. Head: meta charset, viewport, title, meta description
3. Body structure using semantic elements:
- header (site branding + navigation)
- main (primary content area)
- footer (copyright, links, contact)
4. Landmark roles where appropriate
5. Skip navigation link for accessibility
Do NOT include any CSS or JavaScript — just clean, semantic HTML.
✅ 확인 질문: 프롬프트에서 “CSS나 JavaScript 없이"를 명시하는 이유는?
관심사를 섞으면 초기 프롬프트에서 지저분한 코드가 나와요. AI가 HTML, CSS, JavaScript를 한꺼번에 생성하면 스타일링을 빨리 작동시키려고 HTML 구조에서 타협하는 경우가 많아요. HTML만 요청하면 AI가 올바른 시맨틱과 접근성에 집중하게 돼요 — 이것이 모든 것의 기초예요.
내비게이션
내비게이션은 올바르게 만들기 가장 복잡한 HTML 컴포넌트 중 하나예요:
Create a semantic navigation component for a website with these pages:
- Home
- About
- Services (with dropdown: Consulting, Training, Support)
- Blog
- Contact
Requirements:
- Use nav element with aria-label
- Use unordered list structure
- Dropdown must be keyboard-accessible (Enter to open, Escape to close, Arrow keys to navigate)
- Include aria-expanded and aria-haspopup for the dropdown trigger
- Mark the current page with aria-current="page"
- Mobile-friendly structure (will add CSS later)
HTML only — no CSS or JavaScript yet.
한국 웹에서는 네이버, 다음 같은 포털 사이트의 메가 메뉴 구조가 익숙할 거예요. 시맨틱하게 만들면 이런 복잡한 내비게이션도 접근성을 보장할 수 있어요.
모두를 위한 폼
폼은 접근성이 가장 중요한 곳이에요:
Create an HTML form for [purpose: contact / registration / checkout / survey].
Fields:
1. [field name] — [type: text/email/tel/select/textarea/checkbox/radio] — [required/optional]
2. [field name] — [type] — [required/optional]
3. [repeat for all fields]
Accessibility requirements:
- Every input has a label element linked via for/id
- Required fields marked with aria-required="true" and visual indicator
- Error message containers with aria-describedby linking to each input
- Fieldset/legend for related groups (radio buttons, checkboxes)
- Submit button (not input type="submit")
- Form has an accessible name via aria-label or aria-labelledby
Include placeholder text only where it adds value (not as a label replacement).
한국 웹사이트에서 자주 보는 회원가입 폼을 떠올려보세요. 이름, 이메일, 비밀번호에 전화번호 인증까지 — 이런 복잡한 폼이야말로 AI가 접근 가능하게 빠르게 만들 수 있는 영역이에요.
콘텐츠 섹션
아티클과 블로그 포스트 구조
Create semantic HTML for a blog post page:
Content structure:
- Article title (h1)
- Author name and publish date (with time element)
- Featured image with descriptive alt text
- Article body with:
- 3-4 sections with h2 headings
- A blockquote
- An ordered list
- A code snippet (use pre + code elements)
- Tags/categories section
- Author bio box
- Related posts section (3 cards with title, excerpt, link)
Use article, section, aside, figure, figcaption, time elements appropriately.
카드와 목록 페이지
Create semantic HTML for a listing page showing [products / blog posts / team members / portfolio items]:
Page structure:
- Page heading (h1) with item count
- Filter/sort controls (using form elements)
- Grid of cards, each containing:
- Image with alt text
- Title (h3, linked)
- Brief description
- [metadata: price / date / role / tags]
- Call-to-action link or button
- Pagination (using nav element with aria-label="Pagination")
Use unordered list for the card grid (li for each card). Each card should be an article element.
HTML 검증 체크리스트
AI가 HTML을 생성한 후, 이 체크리스트로 확인하세요:
Review this HTML for quality and accessibility:
[paste your HTML]
Check for:
1. Semantic elements used correctly (not div soup)
2. Heading hierarchy (h1 → h2 → h3, no skipped levels)
3. All images have meaningful alt text (not "image" or empty for decorative)
4. Form inputs have associated labels
5. Links have descriptive text (not "click here")
6. Language attribute on html element
7. Meta viewport for responsive design
8. No inline styles or scripts
9. Valid HTML5 structure
List any issues found and provide corrected code.
✅ 확인 질문: “제목 레벨을 건너뛰지 않았는지” 확인하는 이유는?
스크린 리더 사용자는 제목 레벨로 내비게이션해요 — h1에서 h2, h3으로 목차처럼 이동하는 거예요. h1에서 h3으로 건너뛰면 이 내비게이션에 갭이 생겨 혼란을 줘요. 제목 계층은 시각적 장식(그건 CSS의 역할)이 아니라, 보조 기술이 의존하는 문서 구조예요.
한국의 웹 접근성 인증인 KWCAG 2.2에서도 적절한 제목 구조를 요구하고 있어요. 한국 공공기관 웹사이트는 웹 접근성 준수가 의무이기도 하고요.
연습: 페이지 구조 만들기
- 페이지 유형을 선택하세요 (랜딩 페이지, 블로그 포스트, 포트폴리오)
- 페이지 뼈대 프롬프트로 기본 HTML을 생성하세요
- 드롭다운이 하나 이상 있는 내비게이션 컴포넌트를 추가하세요
- 페이지 유형에 맞는 콘텐츠 섹션을 추가하세요
- 완성된 HTML에 검증 체크리스트를 실행하세요
- 브라우저에서 파일을 열어보세요 — 스타일은 없지만 콘텐츠 구조가 논리적이고 완전해야 해요
핵심 정리
- 시맨틱 HTML(header, nav, main, article, footer)은 브라우저, 스크린 리더, 검색 엔진에 의미를 전달해요 — div 기반 레이아웃은 아무것도 전달하지 않아요
- HTML을 CSS, JavaScript와 분리해서 생성하면 AI가 올바른 구조와 접근성에 집중해요
- 상세한 폼 프롬프트(필드 유형, 유효성 검사, 라벨, 에러 위치)가 프로덕션 수준의 폼을 만들어요
- 모든 이미지에 의미 있는 alt 텍스트, 모든 폼 인풋에 라벨, 제목은 계층 구조를 따르는지 — AI 생성 후마다 확인하세요
- 내비게이션 컴포넌트에는 키보드 접근성(Enter, Escape, 화살표 키)과 ARIA 속성이 필요해요 — 프롬프트에서 명시적으로 요청하세요
- 모든 AI 생성 HTML에 스타일이나 동작을 추가하기 전에 접근성 검증을 실행하세요
다음 레슨: HTML 구조에 CSS를 추가해요 — 반응형 레이아웃, 모던 스타일링 기법, 모든 디바이스에서 작동하는 디자인 시스템.
이해도 체크
먼저 위의 퀴즈를 완료하세요
레슨 완료!