본문 바로가기
과목
  • 1 HTML 기초
    1.1

    첫 번째 페이지 만들기

    HTML describes a web page with tags. A tag is a word in angle brackets, like <p>. Most come in pairs — an opening tag <p> and a closing tag </p> wrap some content. A tag plus its content is an element.

    <p>Hello, world!</p>
    <p>This is my first web page.</p>
    
    • The browser draws whatever is between the tags.
    • A tag you forget to close, or spell wrong, may not show correctly.
    One element = opening tag + content + closing tag
    One element = opening tag + content + closing tag
    1.2

    제목 및 단락

    헤딩은 여섯 가지 수준을 표시하며, <h1>(최상위)부터 <h6>(최하위)까지이며, CSS가 크기를 제어합니다. 문단(paragraph)은 <p>입니다. 페이지의 주요 제목에는 정확히 하나의 <h1>을 사용하십시오.

    <h1>My Blog</h1>
    <h2>About me</h2>
    <p>I am learning to build web pages.</p>
    
    1.3

    텍스트 서식 지정

    중요성(보통 굵게)에는 <strong>을, 강조 강조(보통 기울임체)에는 <em>을 사용하십시오. CSS가 외관을 변경할 수 있습니다. 줄 바꿈(line break)은 <br> — 닫는 태그가 없습니다.

    <p><strong>Warning:</strong> read this carefully.</p>
    <p>First line<br>second line</p>
    <p>You can <em>emphasise</em> any word.</p>
    

    Common mistakes

    • 대부분의 요소는 열림 및 닫힘 태그를 사용합니다. 잘못된 중첩(bad nesting)은 브라우저가 예상치 못한 방식으로 문서를 수리하게 만들 수 있습니다.
    • The tag goes in angle brackets; the text you see goes between the opening and closing tags.
    • 제목은 1(<h1>)부터 6(<h6>)까지 지정합니다. 크기만으로 제목을 선택하지 마십시오.
  • 2 목록, 링크 및 이미지
    2.1

    목록

    An unordered list <ul> shows bullets; an ordered list <ol> shows numbers. Each list item is an <li>.

    <ul>
      <li>Apples</li>
      <li>Oranges</li>
    </ul>
    <ol>
      <li>Wake up</li>
      <li>Go to school</li>
    </ol>
    
    ul for bullets, ol for numbers; each item is li
    ul for bullets, ol for numbers; each item is li
    2.2

    링크

    A link is an anchor <a>. Its href attribute holds the address it points to.

    <a href="https://example.com">Visit Example</a>
    <br>
    <a href="page2.html">Go to the next page</a>
    
    • Add target="_blank" to open the link in a new tab.
    2.3

    이미지

    An image is <img> — it has no closing tag. src is the picture's address; alt is text shown if the image cannot load (and read aloud to blind users).

    <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/Bitmap_VS_SVG.svg/120px-Bitmap_VS_SVG.svg.png"
         alt="bitmap versus vector" width="120">
    <p>If the picture is missing, the alt text shows instead.</p>
    

    Common mistakes

    • 정보 제공 이미지는 의미를 전달하는 대체 텍스트가 필요합니다. 순수 장식용 이미지는 alt=""를 사용합니다. alt를 생략하는 것과 다릅니다. 링크에는 href가 필요합니다.
    • <img>는 별도의 종료 태그가 없습니다.
    • broken src path는 이미지 대신 대체 텍스트를 표시할 수 있습니다 — 파일명 및 폴더를 확인하십시오.
  • 3 페이지 구조
    3.1

    완전한 페이지 예시

    실제 페이지는 고정된 골격을 가집니다. <!DOCTYPE html>은 이것이 HTML5임을 나타냅니다. 모든 요소는 <html> 내부에 위치합니다. <head>은 페이지에 대한 정보를 포함하고, <body>은 사용자가 보는 내용을 담습니다.

    <!DOCTYPE html>
    <html>
      <head>
        <meta charset="utf-8">
        <title>My Page</title>
      </head>
      <body>
        <h1>Welcome</h1>
        <p>This is a complete page.</p>
      </body>
    </html>
    
    페이지는 나뭇가지 구조입니다: head는 페이지를 설명하고, body는 사용자에게 보이는 내용을 담습니다
    페이지는 나뭇가지 구조입니다: head는 페이지를 설명하고, body는 사용자에게 보이는 내용을 담습니다
    • The <title> shows in the browser tab.
    • <meta charset="utf-8"> lets the page show any language.
    3.2

    주석 및 중첩

    주석 <!-- ... -->은 브라우저가 무시하는 메모입니다. 태그는 서로 중첩되며, 각 수준마다 인데팅을 하여 구조가 명확하게 유지되도록 합니다. 열기 순서와 반대로 닫기 태그를 사용합니다.

    <!-- a simple navigation bar -->
    <nav>
      <ul>
        <li><a href="#">Home</a></li>
        <li><a href="#">About</a></li>
      </ul>
    </nav>
    

    Common mistakes

    • 태그는 중첩되어야 하며 겹치지 않아야 합니다: <b><i>text</i></b>, 절대 <b><i>text</b></i>이 아닙니다.
    • 페이지에는 <html>, 제목 및 링크를 위한 <head>, 그리고 사용자에게 보이는 내용을 위한 <body>이 필요합니다.
    • A comment is <!-- ... -->; the browser ignores it.
  • 4 표 및 폼
    4.1

    표

    테이블 <table>은 행 <tr>로 구성됩니다. 헤더 셀은 <th>( 굵게, 중앙 정렬); 일반 데이터 셀은 <td>입니다.

    <style>
      table { border-collapse: collapse; }
      th, td { border: 1px solid; padding: 6px; }
    </style>
    <table>
      <tr><th>Name</th><th>Score</th></tr>
      <tr><td>Mei</td><td>88</td></tr>
      <tr><td>Sam</td><td>71</td></tr>
    </table>
    
    table → tr rows → th/td cells
    table → tr rows → th/td cells
    4.2

    폼

    폼 <form>은 사용자의 입력을 수집합니다. <input>은 상자; <label>은 이를 명명하고; <button>은 제출합니다.

    <form>
      <label>Name: <input type="text" name="name"></label>
      <br><br>
      <label>Age: <input type="number" name="age"></label>
      <br><br>
      <button type="submit">Send</button>
    </form>
    
    • name 속성은 제어 요소의 값과 함께 제출 시 전송되는 키입니다. 이름이 없는 텍스트 입력은 제출되지 않습니다.
    • 일반적인 <input> type 값: text, number, email, password, checkbox.

    Common mistakes

    • 테이블 셀은 행 안에 들어갑니다: <tr>은 <td> 셀을 포함합니다.
    • 모든 폼 입력에는 명확하고 접근 가능하도록 대응하는 <label>이 있어야 합니다.
    • 폼 내부의 버튼은 기본적으로 폼을 제출합니다. 그렇지 않기를 원하면 type="button"을 설정하십시오.
  • 5 박스 및 섹션
    5.1

    div, span 및 의미론적 섹션

    A <div> is a generic block box that groups content on its own lines. A <span> is a generic inline box inside a line of text. You use them to group things so you can style or position them.

    <div>
      <span>Price:</span> <span>$9.99</span>
    </div>
    <div>
      <span>Stock:</span> <span>in stock</span>
    </div>
    

    Semantic tags describe their role, which helps screen readers and search engines. Prefer them over plain <div> where they fit: <header>, <nav>, <main>, <section>, <article>, <footer>.

    <header><h1>My Site</h1></header>
    <main>
      <section>
        <h2>News</h2>
        <p>Today we launched the site.</p>
      </section>
    </main>
    <footer>© 2026 My Site</footer>
    

    Common mistakes

    • <div> is a block (starts a new line); <span> is inline (stays in the text).
    • Use semantic tags like <header>, <nav> and <footer> where they fit, not <div> for everything.
    • Do not use a tag just for its default look — style it with CSS instead.
    div is a block box; span wraps inline text
    div is a block box; span wraps inline text
  • 6 CSS 기초
    6.1

    CSS 추가하기

    CSS 스타일이 HTML을 스타일링한다. 가장 간단한 방법은 <style> 블록을 <head>에 넣는 것이며(더 큰 사이트는 별도의 .css 파일을 사용하여 <link>를 적용한다). CSS 규칙은 선택자(selector)와 그 다음 declarations라고 불리는 { property: value; } 쌍으로 구성된다.

    <style>
      p  { color: blue; font-size: 18px; }
      h1 { color: darkred; }
    </style>
    <h1>Styled heading</h1>
    <p>This paragraph is blue.</p>
    
    Link a stylesheet so CSS rules style HTML elements
    Link a stylesheet so CSS rules style HTML elements
    6.2

    셀렉터: class 및 id

    한 class가 여러 요소를 스타일링할 때: HTML에 class="..."를 추가하고 CSS에 .name를 작성한다. id는 ONE 요소만 스타일링한다: id="..."와 #name.

    <style>
      .note  { color: green; }
      #title { font-size: 24px; }
    </style>
    <h1 id="title">Welcome</h1>
    <p class="note">First note.</p>
    <p class="note">Second note.</p>
    

    가장 자주 마주하게 될 선택자들은 다음과 같다:

    Selector Chooses
    p every <p> element
    .note everything with class="note"
    #title the one element with id="title"
    h1, h2 several selectors at once
    nav a every <a> inside a <nav>
    .btn:hover one state of an element (see topic 10)

    Common mistakes

    • class 선택자는 .로 시작하고 id 선택자는 #로 시작한다.
    • 스타일시트를 <head>에 연결하거나, 규칙들을 <style> 블록 안에 포함시킨다.
    • class는 여러 요소에서 재사용할 수 있으나, id는 페이지당 한 번만 사용해야 한다.
  • 7 색상 및 텍스트
    7.1

    색상 및 배경

    color로 텍스트 색상을, background-color로 배경을 설정합니다. 색상은 이름(red), 헥스 코드(#ff0000), 또는 rgb(255, 0, 0)일 수 있습니다.

    <style>
      body { background-color: #f0f4ff; }
      .card { background-color: white; color: #1e3a8a; padding: 12px; }
    </style>
    <div class="card">A card with its own colours.</div>
    
    CSS colours: named, hex, and rgb()
    CSS colours: named, hex, and rgb()
    7.2

    텍스트 스타일링

    Common text properties: font-size, font-weight (e.g. bold), font-family, text-align (left / center / right), and line-height for spacing.

    <style>
      h1 { font-family: Arial, sans-serif; text-align: center; }
      p  { font-size: 18px; line-height: 1.6; }
    </style>
    <h1>Centered title</h1>
    <p>Readable paragraph text with comfortable line spacing.</p>
    

    Common mistakes

    • color은 텍스트 색상을 설정하고, background-color은 배경을 설정합니다.
    • 색상은 이름, #rrggbb 헥스 코드, 또는 rgb(...)일 수 있습니다.
    • braces 내부의 각 선언은 세미콜론 ;으로 끝내야 합니다—이것은 property: value 쌍을 분리합니다(마지막 선언 이후의 것은 선택 사항입니다). 규칙 자체는 닫는 braces }으로 끝납니다.
  • 8 박스 모델
    8.1

    박스 모델

    모든 요소는 네 개의 층을 가진 상자로 표현됩니다. 안쪽부터 바깥쪽으로: 콘텐츠, 패딩(보더 내부의 공간), 보더, 마진(보더 외부의 공간).

    <style>
      .box { background: #dbeafe; border: 3px solid #2563eb;
             padding: 16px; margin: 20px; }
    </style>
    <div class="box">content + padding + border + margin</div>
    
    상자 모델: 콘텐츠, 패딩, 보더, 마진 순서
    상자 모델: 콘텐츠, 패딩, 보더, 마진 순서
    8.2

    마진 및 패딩

    padding은 보더 안쪽에 공간을 추가하여 콘텐츠를 안쪽으로 밀어냅니다. margin은 보더 바깥에 공간을 추가하여 다른 상자들을 멀리 밀어냅니다. 모든 변에 대한 값을 하나, 혹은 네 개(위·오른쪽·아래·왼쪽)를 입력할 수 있습니다.

    <style>
      .a { background: #fde68a; padding: 4px; }
      .b { background: #bbf7d0; padding: 20px; margin-top: 16px; }
    </style>
    <div class="a">tight padding</div>
    <div class="b">roomy padding</div>
    
    8.3

    디스플레이

    display 속성은 상자의 흐름 방식을 지정합니다. block은 전체 줄을 차지하며, inline은 텍스트 행 내부에 위치하고, none은 상자를 완전히 제거하며, flex은 자식 요소를 한 줄로 나열합니다(다음 주제).

    <style>
      .hidden { display: none; }
      .chip { display: inline; background: #e0e7ff; padding: 2px 8px; border-radius: 6px; }
    </style>
    <p>Visible text. <span class="hidden">(secret)</span> <span class="chip">a chip</span></p>
    

    Common mistakes

    • 패딩은 보더 내부에, 마진은 외부의 공간입니다.
    • box-sizing: border-box은 설정된 너비에 패딩과 보더가 포함되게 하여, 일반적으로 원하는 결과를 얻을 수 있습니다.
    • display: none hides an element completely; visibility: hidden leaves its space.
  • 9 레이아웃
    9.1

    너비 및 중앙 정렬

    상자의 width을 설정하세요. 블록을 중앙에 배치하려면 너비와 margin: 0 auto을 지정하고, auto은 남은 공간을 왼쪽과 오른쪽에 균등하게 배분합니다.

    <style>
      .page { width: 300px; margin: 0 auto; background: #e0e7ff;
              padding: 16px; text-align: center; }
    </style>
    <div class="page">A centered, fixed-width page.</div>
    
    9.2

    플렉스박스(Flexbox)

    플렉스 박스는 자식 요소를 한 줄(또는 열)로 배치합니다. 부모(컨테이너)에 display: flex을 설정하세요. gap은 자식 요소 사이의 간격을 추가하고, flex: 1은 너비를 공유하게 합니다.

    <style>
      .row { display: flex; gap: 10px; }
      .row div { background: #93c5fd; padding: 12px; flex: 1; text-align: center; }
    </style>
    <div class="row">
      <div>One</div>
      <div>Two</div>
      <div>Three</div>
    </div>
    
    플렉스 컨테이너는 주축을 따라 아이템을 배치하며; gap은 요소 사이에 간격을 더함
    플렉스 컨테이너는 주축을 따라 아이템을 배치하며; gap은 요소 사이에 간격을 더함
    9.3

    미니 프로젝트: 프로필 카드

    상자, 색상, 텍스트, 간격을 결합하여 작은 컴포넌트를 만드세요.

    <style>
      .card { width: 240px; margin: 0 auto; border: 1px solid #cbd5e1;
              border-radius: 12px; padding: 16px; font-family: sans-serif; }
      .card h2 { margin: 0; color: #1e3a8a; }
      .card .role { color: #64748b; margin: 4px 0 8px; }
    </style>
    <div class="card">
      <h2>Mei Chen</h2>
      <p class="role">Student · Grade 11</p>
      <p>Loves maths and building web pages.</p>
    </div>
    

    Common mistakes

    • 고정된 너비를 가진 블록을 margin: 0 auto으로 중앙에 배치하세요.
    • Flexbox needs display: flex on the CONTAINER, not on the items.
    • % 내의 너비는 부모에 대해 상대적이므로, 부모의 너비도 확인해야 합니다.
  • 10 심화 학습
    10.1

    호버 및 가짜 클래스

    가상 클래스는 요소를 특정 상태에서 스타일링합니다. :hover은 마우스가 요소 위에 있을 때 적용됩니다. transition을 추가하여 변화가 매끄럽게 일어나도록 하고 점프하지 않게 하십시오.

    <style>
      .btn { background: #2563eb; color: white; padding: 10px 18px;
             border: none; border-radius: 8px; font-size: 16px;
             transition: background 0.3s; }
      .btn:hover { background: #16a34a; }
    </style>
    <button class="btn">Hover me</button>
    
    • 기타 유용한 가상 클래스: :focus(초점을 가진 요소, 예: Tab 또는 클릭 후) 및 :first-child.
    :hover 포인터가 요소 위에 있을 때 요소를 스타일링
    :hover 포인터가 요소 위에 있을 때 요소를 스타일링
    10.2

    배치(Positioning)

    포지셔닝은 박스를 정상 위치에서 이동시킵니다. relative는 박스(및 자식 요소의 기준점)를 미세 조정하고; absolute은 가장 가까운 포지셔닝된 조상 요소를 기준으로 박스를 정확히 배치하며; fixed은 페이지 스크롤 시 일반적으로 뷰포트에 고정됩니다. 변환된 조상 요소가 대신 containing block을 생성할 수 있습니다.

    <style>
      .card { position: relative; width: 260px; height: 90px;
              background: #dbeafe; border-radius: 10px; padding: 12px; }
      .badge { position: absolute; top: -10px; right: -10px;
               background: #dc2626; color: white; padding: 4px 10px;
               border-radius: 999px; font-size: 13px; }
    </style>
    <div class="card">
      A product card
      <span class="badge">NEW</span>
    </div>
    
    • top, right, bottom, left은 이동 거리를 지정합니다 — 배치된 상자에서만 작동합니다.
    10.3

    미디어 쿼리 및 반응형 디자인

    반응형 페이지는 화면 크기에 맞춰 조정됩니다. 미디어 쿼리는 화면에 대한 특정 조건(예: max-width)이 성립할 때만 규칙을 적용합니다.

    <style>
      .banner { background: #2563eb; color: white; padding: 16px; }
      @media (max-width: 600px) {
        .banner { background: #16a34a; }   /* narrow screens turn green */
      }
    </style>
    <div class="banner">Resize the window: blue when wide, green when narrow.</div>
    
    • 모바일 피스 트를 설계하십시오: 먼저 휴대폰 스타일을 작성한 후 더 큰 화면을 위한 @media (min-width: ...) 규칙을 추가하십시오.
    • 백분율 너비와 max-width은 상자가 화면에 따라 축소되게 합니다.

    Common mistakes

    • :hover는 선택자와 공백 없이 결합됩니다: .btn:hover, .btn :hover가 아닙니다.
    • position: absolute는 가장 가까운 포지셔닝된 조상 요소를 기준으로 측정되므로, 의도하는 containing 조상 요소인 position: relative을 명시해야 합니다. containing 조상 요소가 없으면 초기 containing block이 사용됩니다.
    • 미디어 쿼리는 전체 규칙을 감쌉니다: @media (max-width: 600px) { .a { ... } }.

로그인 또는 계정 만들기

IGCSE, A-Level & AP