diff options
| author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:17 -0500 |
|---|---|---|
| committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:17 -0500 |
| commit | da78a9e329e272dedb2400b79a3bdeebff387d47 (patch) | |
| tree | e6ef8aa7c43556f55ddfe031a01cf0a8fa271bfe /files/ko/web/css/css_lists_and_counters | |
| parent | 1109132f09d75da9a28b649c7677bb6ce07c40c0 (diff) | |
| download | translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.gz translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.bz2 translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.zip | |
initial commit
Diffstat (limited to 'files/ko/web/css/css_lists_and_counters')
| -rw-r--r-- | files/ko/web/css/css_lists_and_counters/index.html | 57 | ||||
| -rw-r--r-- | files/ko/web/css/css_lists_and_counters/using_css_counters/index.html | 148 |
2 files changed, 205 insertions, 0 deletions
diff --git a/files/ko/web/css/css_lists_and_counters/index.html b/files/ko/web/css/css_lists_and_counters/index.html new file mode 100644 index 0000000000..7d3ecd8e4f --- /dev/null +++ b/files/ko/web/css/css_lists_and_counters/index.html @@ -0,0 +1,57 @@ +--- +title: CSS Lists and Counters +slug: Web/CSS/CSS_Lists_and_Counters +tags: + - CSS + - CSS Lists + - Overview + - Reference +translation_of: Web/CSS/CSS_Lists_and_Counters +--- +<div>{{CSSRef}}</div> + +<p><strong>CSS Lists</strong>는 리스트 배치 방법, 리스트 마커를 스타일 할 수 있는 법을 정의하는 CSS 모듈입니다.</p> + +<h2 id="참고서">참고서</h2> + +<h3 id="속성">속성</h3> + +<div class="index"> +<ul> + <li>{{cssxref("list-style-image")}}</li> + <li>{{cssxref("list-style-type")}}</li> + <li>{{cssxref("list-style-position")}}</li> + <li>{{cssxref("list-style")}}</li> +</ul> +</div> + +<h2 id="안내서">안내서</h2> + +<dl> + <dt><a href="/ko/docs/Consistent_List_Indentation">일관된 리스트 들여쓰기</a></dt> + <dd>서로 다른 브라우저 사이에 일관된 들여쓰기를 이루는 법을 설명합니다.</dd> +</dl> + +<h2 id="명세">명세</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">명세</th> + <th scope="col">상태</th> + <th scope="col">설명</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('CSS3 Lists')}}</td> + <td>{{Spec2('CSS3 Lists')}}</td> + <td> </td> + </tr> + <tr> + <td>{{SpecName('CSS2.1', 'generate.html')}}</td> + <td>{{Spec2('CSS2.1')}}</td> + <td>초기 정의</td> + </tr> + </tbody> +</table> diff --git a/files/ko/web/css/css_lists_and_counters/using_css_counters/index.html b/files/ko/web/css/css_lists_and_counters/using_css_counters/index.html new file mode 100644 index 0000000000..4557bc725c --- /dev/null +++ b/files/ko/web/css/css_lists_and_counters/using_css_counters/index.html @@ -0,0 +1,148 @@ +--- +title: CSS 카운터 사용하기 +slug: Web/CSS/CSS_Lists_and_Counters/Using_CSS_counters +tags: + - CSS + - CSS Counter Styles + - Guide + - Layout + - Reference + - Web + - 번호 + - 카운터 +translation_of: Web/CSS/CSS_Lists_and_Counters/Using_CSS_counters +--- +<div>{{CSSRef}}</div> + +<p><strong>CSS counters</strong>를 사용하면 문서에서의 위치에 따라 콘텐츠의 모양을 조정할 수 있습니다. 예를 들어, counters를 사용해 웹페이지의 제목에 자동으로 번호를 매길 수 있습니다. Counters는 요소가 몇 번이나 사용되었는지 추적하여 CSS 규칙에 따라 증가하며, 본질적으로 변수입니다.</p> + +<h2 id="Counters_사용하기">Counters 사용하기</h2> + +<h3 id="카운터_값_조작하기">카운터 값 조작하기</h3> + +<p>CSS counter를 사용하려면 먼저 {{cssxref("counter-reset")}} 속성(초깃값 <code>0</code>)을 사용하여 초기화 해야합니다. 동일한 속성으로 값을 특정 값으로 바꿀 수도 있습니다. 초기화 된 counter의 값은 {{cssxref("counter-increment")}}에 따라 증가하거나 감소합니다. counter의 이름으로 "none", "inherit", "initial"은 사용불가합니다. 이런 이름을 사용하면 선언은 무시됩니다.</p> + +<h3 id="카운터_표시하기">카운터 표시하기</h3> + +<p>Counter의 값은 {{cssxref("content")}} 속성에서 {{cssxref("counter()")}}나 {{cssxref("counters()")}} 함수를 사용하여 표시할 수 있습니다.</p> + +<p><code>counter()</code> 함수는 'counter(name)'와 'counter(name, style)' 두 가지 형태로 사용할 수 있습니다. 생성된 텍스트는 가상 요소가 속한 범위에 있는 이름(name)의 가장 안쪽 counter의 값입니다. 텍스트는 지정된 서식(기본값은 십진수<code>decimal</code>)으로 뿌려집니다.</p> + +<p><code>counters()</code> 함수도 'counters(name, string)'나 'counters(name, string, style)' 두 가지 형태로 사용할 수 있습니다. 생성된 텍스트는 가상 요소가 속한 모든 범위에서 지정된 이름을 가진 counters의 값으로, 바깥 쪽부터 안쪽까지 값이 주어지며 지정된 문자열로 구분됩니다. counters는 지정된 스타일(기본값은 십진수<code>decimal</code>)로 렌더링 됩니다.</p> + +<h3 id="기본_예제">기본 예제</h3> + +<p>여기서는 제목 앞에 숫자를 붙여봅니다.</p> + +<h4 id="CSS">CSS</h4> + +<pre class="brush: css notranslate">body { + counter-reset: section; /* counter 이름을 'section'으로 지정합니다. + 초깃값은 0입니다. */ +} + +h3::before { + counter-increment: section; /* section의 카운터 값을 1씩 증가시킵니다. */ + content: counter(section); /* section의 카운터 값을 표시합니다. */ +} +</pre> + +<h4 id="HTML">HTML</h4> + +<pre class="brush: html notranslate"><h3>Introduction</h3> +<h3>Body</h3> +<h3>Conclusion</h3></pre> + +<h4 id="결과">결과</h4> + +<p>{{EmbedLiveSample("Basic_example", "100%", 150)}}</p> + +<h2 id="중첩_카운터">중첩 카운터</h2> + +<p>CSS 카운터는 자식 요소 안에서 새 인스턴스를 자동으로 만들어주어 목차를 만드는데 유용합니다. {{cssxref("counters()")}} 함수를 사용해 중첩된 다른 레벨의 카운터 사이를 분리하는 글자를 지정할 수 있습니다.</p> + +<h3 id="중첩_카운터_예제">중첩 카운터 예제</h3> + +<h4 id="CSS_2">CSS</h4> + +<pre class="brush: css notranslate">ol { + counter-reset: section; /* ol 요소마다 + 이름이 section인 + 새 인스턴스를 생성합니다. */ + list-style-type: none; +} + +li::before { + counter-increment: section; /* 해당 인스턴스 안에서 + section 카운터 값 증가 */ + content: counters(section, ".") " "; /* section 카운터 값을 + 마침표(.)로 구분해 결합하여 + 표시합니다. */ +} +</pre> + +<h4 id="HTML_2">HTML</h4> + +<pre class="brush: html notranslate"><ol> + <li>item</li> <!-- 1 --> + <li>item <!-- 2 --> + <ol> + <li>item</li> <!-- 2.1 --> + <li>item</li> <!-- 2.2 --> + <li>item <!-- 2.3 --> + <ol> + <li>item</li> <!-- 2.3.1 --> + <li>item</li> <!-- 2.3.2 --> + </ol> + <ol> + <li>item</li> <!-- 2.4.1 --> + <li>item</li> <!-- 2.4.2 --> + <li>item</li> <!-- 2.4.3 --> + </ol> + </li> + <li>item</li> <!-- 2.4 --> + </ol> + </li> + <li>item</li> <!-- 3 --> + <li>item</li> <!-- 4 --> +</ol> +<ol> + <li>item</li> <!-- 1 --> + <li>item</li> <!-- 2 --> +</ol></pre> + +<h4 id="결과_2">결과</h4> + +<p>{{EmbedLiveSample("Example_of_a_nested_counter", "100%", 350)}}</p> + +<h2 id="Specifications">Specifications</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName("CSS3 Lists", "#auto-numbering", "CSS Counters")}}</td> + <td>{{Spec2("CSS3 Lists")}}</td> + <td>No change</td> + </tr> + <tr> + <td>{{SpecName("CSS2.1", "generate.html#counters", "CSS Counters")}}</td> + <td>{{Spec2("CSS2.1")}}</td> + <td>Initial definition</td> + </tr> + </tbody> +</table> + +<h2 id="See_also">See also</h2> + +<ul> + <li>{{cssxref("counter-reset")}}</li> + <li>{{cssxref("counter-increment")}}</li> + <li>{{cssxref("@counter-style")}}</li> +</ul> |
