Contents
see List작성일 2015. 02. 24.
CSS Form Selector (속성 선택자)
폼 요소를 타입별로 선택할 때 사용하는 CSS 속성 선택자입니다.
기본 문법
input[type="text"]
input[type="password"]
input[type="email"]
주요 폼 선택자
/* 텍스트 입력 필드 */
input[type="text"] {
border: 1px solid #ccc;
padding: 8px;
}
/* 비밀번호 필드 */
input[type="password"] {
border: 1px solid #999;
}
/* 체크박스 */
input[type="checkbox"] {
width: 16px;
height: 16px;
}
/* 라디오 버튼 */
input[type="radio"] {
margin-right: 5px;
}
/* 제출 버튼 */
input[type="submit"],
button[type="submit"] {
background-color: #007bff;
color: white;
cursor: pointer;
}
/* 파일 업로드 */
input[type="file"] {
padding: 5px;
}
속성 선택자 종류
| [attr] | 속성이 존재하는 요소 |
| [attr=value] | 정확히 일치 |
| [attr^=value] | 시작 값 일치 |
| [attr$=value] | 끝 값 일치 |
| [attr*=value] | 포함 여부 |
활용 예시
/* 필수 입력 필드 */
input[required] {
border-left: 3px solid red;
}
/* disabled 상태 */
input:disabled {
background-color: #f5f5f5;
cursor: not-allowed;
}
/* placeholder 스타일 */
input::placeholder {
color: #999;
font-style: italic;
}html
| No | 작성일 | Title |
|---|---|---|
| 2888 | 2026. 05. 26. | 반응형 이미지 운영 가이드: srcset, sizes, picture, lazy loading으로 LCP와 트래픽 줄이기 |
| 2824 | 2026. 05. 18. | 실무 문의 폼 접근성 점검: fieldset, autocomplete, Constraint Validation API 적용법 |
| 2626 | 2026. 04. 27. | CSS Anchor Positioning 완벽 가이드 — JavaScript 없이 툴팁·팝오버를 정밀하게 배치하는 새로운 CSS 표준 |
| 2547 | 2026. 04. 19. | HTML Invoker Commands API 완벽 가이드: JavaScript 없이 버튼으로 팝업·다이얼로그 제어하기 |
| 2494 | 2026. 04. 14. | 2025/2026 CSS 최신 기능 완벽 정리: View Transitions, Anchor Positioning, 스크롤 애니메이션 |
| 2473 | 2026. 04. 13. | CSS 2026 완벽 가이드: Scroll-Driven Animations, View Transitions, Masonry Layout |
| 2453 | 2026. 04. 12. | CSS @layer, :has(), View Transitions API 실전 가이드: 모던 CSS의 새로운 표준 |
| 2429 | 2026. 04. 11. | CSS Anchor Positioning과 Popover API 실전 가이드 |
| 2393 | 2026. 04. 09. | CSS Anchor Positioning과 Popover API 실전 가이드 - JavaScript 없는 UI 구현 |
| 2372 | 2026. 04. 08. | 2025-2026 CSS 최신 기능 완전 가이드: Container Queries, CSS Nesting, View Transitions, Scroll-driven Animations |