Contents
see List작성일 2014. 09. 25.
CSS 리스트 스타일 (list-style)
ul, ol 목록의 불릿 및 번호 스타일을 지정하는 속성입니다.
기본 문법
list-style: none; /* 스타일 제거 */
list-style-type 값
| 값 | 설명 | 예시 |
|---|---|---|
| none | 마커 없음 | |
| disc | 채워진 원 (기본값) | ● |
| circle | 빈 원 | ○ |
| square | 채워진 사각형 | ■ |
| decimal | 숫자 | 1, 2, 3 |
| decimal-leading-zero | 앞에 0 붙은 숫자 | 01, 02, 03 |
| lower-roman | 소문자 로마숫자 | i, ii, iii |
| upper-roman | 대문자 로마숫자 | I, II, III |
| lower-alpha | 소문자 알파벳 | a, b, c |
| upper-alpha | 대문자 알파벳 | A, B, C |
| korean-hangul-formal | 한글 숫자 | 일, 이, 삼 |
사용 예시
/* 기본 스타일 제거 */
ul {
list-style: none;
padding: 0;
margin: 0;
}
/* 커스텀 불릿 */
ul.custom {
list-style-type: square;
}
/* 위치 변경 */
ul.inside {
list-style-position: inside; /* 텍스트 안쪽에 마커 */
}
/* 이미지 마커 */
ul.image-bullet {
list-style-image: url("bullet.png");
}
list-style 단축 속성
/* list-style: type position image */
ul {
list-style: square inside none;
}
/* 순서 무관 */
ul {
list-style: inside url("bullet.png");
}
커스텀 마커 (::marker)
/* 마커 색상 변경 */
li::marker {
color: #007bff;
font-size: 1.2em;
}
/* 이모지 마커 */
li::marker {
content: "👉 ";
}
CSS로 완전 커스텀
ul.custom-list {
list-style: none;
padding-left: 20px;
}
ul.custom-list li::before {
content: "✓";
color: green;
margin-right: 10px;
font-weight: bold;
}
네비게이션 메뉴 스타일
nav ul {
list-style: none;
display: flex;
gap: 20px;
padding: 0;
}
nav ul li a {
text-decoration: none;
}html
| No | 작성일 | Title |
|---|---|---|
| 2054 | 2025. 11. 30. | HTML5 시맨틱 태그 완벽 가이드 |
| 1944 | 2024. 08. 06. | 크롬 html input 에서 자동완성 막기 |
| 1884 | 2023. 02. 24. | [ css ] width : height , 1:1 로 맞추기 |
| 1564 | 2020. 11. 29. | [ html ] 크롬 자동완성 끄기 |
| 1116 | 2016. 10. 10. | [ css ] textarea 줄바꿈 html 인식하기 |
| 337 | 2016. 01. 14. | [ jstl ] jstl 에서 현재날짜 기준으로 연산 |
| 325 | 2015. 11. 04. | [ html ] div 하단정렬 |
| 316 | 2015. 10. 12. | [ jstl ] number format ( 1000 단위 콤마, 날짜, 금액 ) |
| 314 | 2015. 08. 05. | [ CSS ] div 에 수직 정렬 ( vertical-align ) 설정하기 |
| 276 | 2015. 05. 08. | [ css ] 테이블 글자 자동으로 내려쓰기 |