
style="") / 내부(<style>) / 외부(.css 링크)!important → 명시도(ID > class/속성/의사클래스 > 태그/의사요소) → 소스 순서content + padding + border + margin (box-sizing: border-box 권장)px, %, em(부모 폰트 기준), rem(루트 기준), vw/vh(뷰포트)*, tag, .class, #id, [attr=value]A B), 자식(A > B), 인접 형제(A + B), 일반 형제(A ~ B):hover, :focus, :active, :disabled, :not(), :nth-child(n) 등::before, ::after, ::first-line, ::selectionfont-family: 시스템 폰트 스택 또는 웹폰트 조합
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif; }
font-size: 접근성 고려해 rem 기반 권장(루트 62.5% = 10px 관례는 선택)
font-weight: 100–900 단계(가변 폰트일수록 세밀)
line-height: 단위 없이 비율로 지정 권장(예: 1.5)
@font-face: 웹폰트 로드, font-display: swap로 FOUT 최소화
color, text-decoration(링크 밑줄/두께/스타일), text-transform(대소문자 변환)
letter-spacing, word-spacing: 자간·어간
white-space: 줄바꿈/공백 처리(nowrap, pre, 등)
넘침 제어:
.ellipsis {
overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
강제 줄바꿈: overflow-wrap: anywhere; 또는 word-break: break-all;
direction: ltr | rtltext-align: left | right | center | justifytext-justify: inter-word | inter-character | distributeline-height: normal | 수치 | px | em | %/* 흐름 / 정렬 / 행간 예시 */
.rtl { direction: rtl; }
.center{ text-align: center; }
.just { text-align: justify; text-justify: inter-word; }
.read { line-height: 1.6; }
list-style-type: disc | circle | square | decimal | lower-roman | upper-alpha | none ...list-style-image: url(경로)list-style: <type> <image> <position>list-style-position: outside | inside/* 불릿·번호·이미지 마커 */
ul.basic { list-style-type: disc; } /* 기본 채운 원 */
ol.roman { list-style-type: lower-roman; } /* 소문자 로마 */
ul.custom { list-style-image: url(/img/bullet.png); }
.no-bullet { list-style: none; padding-left: 0; }
Display: block, inline, inline-block, flex, grid
Flex: 1차원(가로/세로) 배치, 정렬·간격에 유리
.row { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
Grid: 2차원 배치, 반응형 카드/대시보드에 유리
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
!important 최소화direction, word-break, 웹폰트 서브셋(한글/라틴) 분리@media (prefers-color-scheme: dark)로 테마 대응:root {
--fg: #222; --bg: #fff;
--accent: #2e6cff;
--font-base: 16px; --lh: 1.6;
}
html { font-size: var(--font-base); }
body {
color: var(--fg); background: var(--bg);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
line-height: var(--lh);
margin: 0;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { margin: 0 0 1em; padding-left: 1.2em; }