LogoSEO Jing
  • All Posts
  • SEO Jing
  • okayJing
  • KD Team
  • CLAB Coreteam
  • Study

Contact Me

© 2026 SEOJing. All rights reserved.

프론트엔드 스터디 대면 3주차: 박스 모델 실전, Position과 Flexbox

2026년 6월 28일·10분 읽기
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
Subtitle fallback
Subtitle component omitted

<strong>font-family</strong>: 쉼표로 여러 폰트를 나열하면 앞에서부터

순서대로 사용 가능한 폰트를 적용합니다. 마지막에 sans-serif 같은 일반 패밀리를 넣는 것이 관례입니다.

<strong>색상 표기법</strong>: 키워드(red), Hex(#FF5733), RGB(`rgb(255, 87,

51)), HSL(hsl(11, 100%, 60%)`) 등 다양한 방식으로 표현합니다.

Subtitle fallback
Subtitle component omitted

<strong>인라인(Inline)</strong>: 콘텐츠 크기만큼만 차지, width/height 무시,

상하 margin 무시

<strong>블록(Block)</strong>: 한 줄 전체를 차지, width/height/margin 모두 적용 <strong>인라인 블록(Inline-block)</strong>: 나란히 배치되면서

width/height/margin 모두 적용

Subtitle fallback
Subtitle component omitted

안쪽부터: <strong>Content → Padding → Border → Margin</strong> <strong>box-sizing: content-box</strong>(기본값): width는 콘텐츠 영역만

의미, padding과 border가 추가로 더해짐

<strong>box-sizing: border-box</strong>: width 안에 padding과 border까지

포함, 현대 CSS의 필수 설정

css
/* content-box: width(200) + padding×2(40) + border×2(10) = 실제 250px */
.box {
  width: 200px;
  padding: 20px;
  border: 5px solid black;
}

/* border-box: 실제 너비 200px 고정, 콘텐츠 영역 = 200 - 40 - 10 = 150px */
.box {
  box-sizing: border-box;
  width: 200px;
  padding: 20px;
  border: 5px solid black;
}
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted

<strong>px</strong>: 고정값. 화면 해상도와 무관하게 항상 같은 크기. <strong>em</strong>: <strong>부모 요소</strong>의 font-size 기준. 부모가

16px이면 1em = 16px, 2em = 32px.

<strong>rem</strong>: <strong>루트(<html>)</strong>의 font-size 기준.

기본값은 16px이므로 1rem = 16px. 부모가 누구든 기준이 변하지 않습니다.

css
html {
  font-size: 16px; /* rem의 기준 */
}

.parent {
  font-size: 20px;
}

.child-em {
  font-size: 1.5em; /* 부모(20px) × 1.5 = 30px */
}

.child-rem {
  font-size: 1.5rem; /* 루트(16px) × 1.5 = 24px */
}
Paragraph fallback
Paragraph component omitted
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
css
/* 두 p 태그 사이 간격: 30 + 20 = 50px이 아닌 30px (큰 쪽만) */
.box-a {
  margin-bottom: 30px;
}
.box-b {
  margin-top: 20px;
}

/* 방지법: 부모에 overflow: hidden 또는 padding/border 추가 */
.parent {
  overflow: hidden; /* 새 BFC 생성 → 자식 마진 겹침 차단 */
}

/* 방지법 2: Flexbox 컨테이너 안에서는 마진 겹침 없음 */
.flex-parent {
  display: flex;
  flex-direction: column;
}
Paragraph fallback
Paragraph component omitted
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted

<strong>CSS Reset</strong>: 브라우저 기본 스타일을 전부 제거하고 백지에서

시작. margin: 0, padding: 0을 전체 요소에 적용.

<strong>Normalize.css</strong>: 브라우저 간 차이만 통일. 유용한 기본 스타일은

유지.

css
/* 거의 모든 프로젝트의 첫 줄 — 전체 box-sizing 일괄 설정 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 기본 마진 제거 */
body,
h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
  padding: 0;
}
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
css
/* 링크 앞에 아이콘 추가 */
.link::before {
  content: "→ ";
  color: blue;
}

/* 카드에 장식용 라인 추가 */
.card::after {
  content: ""; /* 빈 문자열 필수 */
  display: block;
  width: 40px;
  height: 3px;
  background: coral;
  margin-top: 8px;
}

/* 활용: 툴팁 말풍선 꼬리 */
.tooltip::before {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: black;
}
Paragraph fallback
Paragraph component omitted
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
css
/* BFC를 만드는 방법들 */
.bfc-1 {
  overflow: hidden; /* 가장 오래된 방법 */
}
.bfc-2 {
  display: flow-root; /* 부작용 없이 BFC만 생성 — 권장 */
}
.bfc-3 {
  display: flex; /* flex/grid 컨테이너는 자동으로 BFC */
}

/* 활용 예: 부모-자식 마진 겹침 방지 */
.card {
  display: flow-root; /* 자식의 margin-top이 부모 밖으로 새지 않음 */
  padding: 16px;
}
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
분류상속 여부대표 속성
텍스트 관련상속됨color, font-family, font-size, line-height
레이아웃 관련상속 안됨margin, padding, border, width, display
css
/* 부모에 color 지정 → 자식 전체에 적용 */
body {
  color: #333;
  font-family: "Pretendard", sans-serif;
}

/* 상속 동작 제어 키워드 */
.child {
  color: inherit; /* 부모 값 강제 상속 */
  color: initial; /* 브라우저 기본값으로 초기화 */
  color: unset; /* 상속되는 속성이면 inherit, 아니면 initial */
}
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
css
/* overflow 기본 동작 */
.box-visible {
  overflow: visible; /* 기본값: 넘쳐도 그냥 표시 */
}
.box-hidden {
  overflow: hidden; /* 넘치는 부분 잘라냄 */
}
.box-scroll {
  overflow: auto; /* 넘칠 때만 스크롤바 표시 */
}

/* 한 줄 텍스트 말줄임 — 세 속성 세트로 사용 */
.ellipsis {
  white-space: nowrap; /* 줄바꿈 금지 */
  overflow: hidden; /* 넘치는 텍스트 숨김 */
  text-overflow: ellipsis; /* 잘린 자리에 ... 표시 */
}
html
<!-- Tailwind: truncate 클래스 하나로 동일하게 적용 -->
<p class="truncate w-48">이 텍스트는 너무 길어서 잘립니다...</p>
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
속성공간 차지클릭 가능대표 사용처
display: none✗ 없음✗완전 제거, 조건부 렌더링
visibility: hidden✓ 있음✗레이아웃 유지하면서 숨기기
opacity: 0✓ 있음✓페이드 인/아웃 애니메이션
css
/* 모달 오버레이 페이드 애니메이션 예시 */
.overlay {
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none; /* opacity: 0이어도 클릭 차단 */
}
.overlay.active {
  opacity: 1;
  pointer-events: auto;
}
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
css
/* cursor: 마우스 포인터 모양 변경 */
.button {
  cursor: pointer; /* 손가락 모양 → 클릭 가능 암시 */
}
.disabled-button {
  cursor: not-allowed; /* 금지 아이콘 → 비활성 상태 암시 */
  opacity: 0.5;
}
.loading {
  cursor: wait; /* 로딩 중 */
}

/* pointer-events: 클릭 이벤트 자체를 차단 */
.overlay {
  pointer-events: none; /* 이 요소 위에서 클릭해도 아래 요소에 전달 */
}
.interactive {
  pointer-events: auto; /* 기본값 — 클릭 가능 */
}
html
<!-- Tailwind 예시 -->
<button class="cursor-pointer hover:bg-blue-600">클릭 버튼</button>
<button class="cursor-not-allowed opacity-50" disabled>비활성 버튼</button>
<div class="pointer-events-none">클릭 통과 레이어</div>

---

Subtitle fallback
Subtitle component omitted
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted

콘텐츠 영역: 300px 좌우 패딩: 20px × 2 = 40px 좌우 보더: 10px × 2 = 20px <strong>실제 화면 너비: 300 + 40 + 20 = 360px</strong>

Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted

---

Paragraph fallback
Paragraph component omitted
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted

실제 화면 너비: <strong>300px</strong> (그대로) 좌우 패딩: 20px × 2 = 40px 좌우 보더: 10px × 2 = 20px <strong>콘텐츠 영역: 300 - 40 - 20 = 240px</strong>

Paragraph fallback
Paragraph component omitted

---

Paragraph fallback
Paragraph component omitted
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
Subtitle fallback
Subtitle component omitted

<strong>부모 요소에 overflow: hidden 적용</strong> <strong>부모 요소에 padding 또는 border 추가</strong> <strong>display: flex 또는 display: grid 컨테이너 사용</strong>:

Flexbox·Grid 안에서는 마진 겹침이 발생하지 않습니다.

Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted

---

Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted

<strong>인접 형제</strong>: 위 요소의 margin-bottom과 아래 요소의

margin-top이 겹침

<strong>부모와 자식</strong>: 부모에 padding이나 border가 없으면, 자식의

margin이 부모 밖으로 새어 나감

<strong>해결법</strong>: 부모에 padding, border, 또는 overflow: hidden을

적용하면 겹침을 방지할 수 있습니다.

Paragraph fallback
Paragraph component omitted
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted

<strong>absolute</strong>: 가장 가까운 position이 static이 아닌 조상

요소를 기준으로 배치됩니다. 그런 조상이 없으면 뷰포트가 기준이 됩니다. 스크롤하면 함께 움직입니다.

<strong>fixed</strong>: 항상 뷰포트(브라우저 화면)를 기준으로 배치됩니다.

스크롤해도 화면의 같은 위치에 고정됩니다. 고정 헤더, 플로팅 버튼 등에 사용합니다.

Paragraph fallback
Paragraph component omitted
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted

<strong>justify-content</strong>: <strong>주축(Main Axis)</strong> 방향으로

정렬합니다. flex-direction: row일 때는 가로 정렬, column일 때는 세로 정렬이 됩니다.

<strong>align-items</strong>: <strong>교차축(Cross Axis)</strong> 방향으로

정렬합니다. flex-direction: row일 때는 세로 정렬, column일 때는 가로 정렬이 됩니다.

Paragraph fallback
Paragraph component omitted

---

Subtitle fallback
Subtitle component omitted

프론트엔드 스터디 3주차 학습 자료: 프론트엔드의 첫 번째 벽, 박스 모델과 스타일링

프론트엔드 스터디 4주차 학습 자료: 자유자재 레이아웃 (포지션과 플렉스박스)

---

Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted
Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted

<strong>미디어 쿼리 (@media)</strong>: 강의에서 화면 크기에 따라 다른 스타일을

적용하는 법을 배웁니다. @media (min-width: 768px) 형태로 작성하며, 데스크톱/태블릿/모바일에 따라 레이아웃을 바꿀 수 있습니다.

<strong>CSS Grid</strong>: 강의 마지막에 Grid가 등장할 수 있습니다. Flexbox가

가로 또는 세로 한 방향이라면, Grid는 행과 열을 동시에 다루는 2차원 레이아웃입니다.

<strong>반응형 단위 (vw, vh)</strong>: 뷰포트(화면) 크기를 기준으로 하는

단위입니다. 100vw는 화면 전체 너비, 100vh는 화면 전체 높이입니다.

Subtitle fallback
Subtitle component omitted
Paragraph fallback
Paragraph component omitted

<strong>영상</strong>: 제대로 파는 HTML & CSS <strong>구간</strong>: 04:28:10 ~ 05:28:02 (약 1시간) <strong>링크</strong>:

Anchor fallback
Anchor component omitted

Post Q&A

오케이징에게 물어보기

프론트엔드 스터디 대면 3주차: 박스 모델 실전, Position과 Flexbox 전체를 기준으로 질문과 피드백을 받아요.답을 본 뒤에는 이 내용을 댓글로 달아서 서징에게도 물어볼 수 있어요. 작성자가 직접 볼 수 있어요!

0/500

포스트 목록

/study/clab-26-1/in-person
파일 9개, 폴더 0개
프론트엔드 스터디 대면 0주차: 프론트엔드 개발자란? 그리고 우리가 배울 것들프론트엔드 스터디 대면 1주차: HTML 마크업과 폼, 그리고 CSS의 시작프론트엔드 스터디 대면 2주차: 폼(Form), CSS 선택자, 그리고 박스 모델프론트엔드 스터디 대면 3주차: 박스 모델 실전, Position과 Flexbox프론트엔드 스터디 대면 6주차(1): HTML/CSS/JS 리마인드와 브라우저 렌더링프론트엔드 스터디 대면 6주차(2): AI 시대의 개발 방식과 프론트엔드 개발자의 위치프론트엔드 스터디 대면 7주차: React 입문과 프로젝트 구조프론트엔드 스터디 대면 8주차: API와 통신 — 프론트엔드와 백엔드의 계약프론트엔드 스터디 대면 9주차: Next.js 렌더링 진화와 웹 퍼포먼스

같은 섹션의 대표 이미지

9 posts · latest first
Study26. 05. 25.

프론트엔드 스터디 대면 9주차: Next.js 렌더링 진화와 웹.

Next.js가 무엇이고 왜 필요한지 React와 비교해 이해한 뒤, CSR부터 SSR, SSG, ISR, PPR까지 렌더링 전략과 Web Vitals를 정리하며 스터디를 마무리합니다.

26. 05. 25.SEOJing
Study26. 05. 18.

프론트엔드 스터디 대면 8주차: API와 통신 — 프론트엔드와.

비동기와 async/await를 배운 뒤, 대면에서는 API를 단순 호출 방법이 아니라 프론트엔드와 백엔드 사이의 계약으로 바라봅니다. HTTP, REST, CORS, 프록시, API 클라이언트 구조, TanStack Query와 파일 배치까지 연결합니다.

26. 05. 18.SEOJing
Study26. 05. 11.

프론트엔드 스터디 대면 7주차: React 입문과 프로젝트 구조.

바닐라 JS의 한계에서 React가 등장한 이유까지, 컴포넌트와 렌더링 방식을 이해하고 프로젝트 구조 감각을 만들어가는 대면입니다.

26. 05. 11.SEOJing
Study26. 05. 04.

프론트엔드 스터디 대면 6주차(1): HTML/CSS/JS.

4~6주차 공백 이후 진행하는 첫 번째 대면입니다. HTML/CSS/JS 핵심을 가볍게 다시 연결하고, 브라우저가 코드를 실제 화면으로 바꾸는 과정을 통해 렌더링 파이프라인과 성능 감각을 잡습니다.

26. 05. 04.SEOJing
Study26. 05. 04.

프론트엔드 스터디 대면 6주차(2): AI 시대의 개발 방식과.

길어진 6주차 대면의 두 번째 차시입니다. AI 시대에 개발자가 실제로 어떻게 일하는지, 그리고 프론트엔드 개발자가 디자이너·백엔드·PM 사이에서 어떤 연결과 리딩 역할을 하는지 다룹니다.

26. 05. 04.SEOJing
Study26. 04. 10.

프론트엔드 스터디 대면 3주차: 박스 모델 실전,.

3주차 박스 모델과 스타일링 복습, 과제 풀이, 4주차 Position과 Flexbox 레이아웃까지 다룬 대면 스터디 정리입니다. 면접에서 자주 나오는 마진 겹침, box-sizing, Flexbox 관련 질문도 함께 준비합니다.

26. 04. 10.SEOJing
Study26. 04. 03.

프론트엔드 스터디 대면 2주차: 폼(Form), CSS.

2주차 폼과 CSS 선택자 복습, 과제 풀이, 3주차 박스 모델과 스타일링까지 다룬 대면 스터디 정리입니다. 면접에서 자주 나오는 GET vs POST, CSS 우선순위, 박스 모델 관련 질문도 함께 준비합니다.

26. 04. 03.SEOJing
Study26. 03. 27.

프론트엔드 스터디 대면 1주차: HTML 마크업과 폼, 그리고.

1주차 HTML 핵심 복습과 과제 풀이, 2주차 폼(Form)과 CSS 선택자까지 다룬 대면 스터디 정리입니다. 면접에서 자주 나오는 시맨틱 HTML, img alt 속성 관련 질문도 함께 준비합니다.

26. 03. 27.SEOJing
Study26. 03. 20.

프론트엔드 스터디 대면 0주차: 프론트엔드 개발자란? 그리고.

프론트엔드 개발자가 실무에서 하는 일, 2025-2026 기술 스택, 현실적인 연봉과 채용 트렌드를 정리했습니다. 스터디 자료 구조와 앞으로의 방향도 함께 안내합니다.

26. 03. 20.SEOJing