πŸ’» Programming/CSS

[CSS] 14. Lists ( 리슀트, λͺ©λ‘ )

μΌ€μ΄μΉ˜ 2016. 6. 12. 18:03

μ΄λ²ˆμ—λŠ” λͺ©λ‘κ³Ό κ΄€λ ¨λœ CSS속성에 λŒ€ν•΄μ„œ μ•Œμ•„λ³΄λ„λ‘ ν•˜κ² μŠ΅λ‹ˆλ‹€. 

μš°μ„  μ–΄λ–€ 속성듀이 μžˆλŠ”μ§€ κ·Έλ†ˆλ“€μ˜ 이름뢀터 ν•œλ²ˆ μ‚΄νŽ΄λ΄…μ‹œλ‹€. 

  • list-style-type 이건 λͺ©λ‘ μŠ€νƒ€μΌ, 예λ₯Ό λ“€λ©΄ 숫자, 영문, 동그라미, μ‚¬κ°ν˜• , 뭐 이런 것듀을 μ„€μ •ν•˜λŠ” μ†μ„±μž…λ‹ˆλ‹€. 

  • list-style-position 이건 λͺ©λ‘μ΄ 인덴트 λ˜μ–΄μ•Ό ν•˜λŠ”μ§€λ₯Ό κ²°μ •ν•˜λŠ” μ†μ„±μž…λ‹ˆλ‹€. ν•˜μœ„ λͺ©λ‘μ΄λƒ μ•„λ‹ˆλƒ 뭐 이런거죠. 

  • list-style-image λͺ©λ‘ μ•žμ— 이미지λ₯Ό λ³΄μ—¬μ£Όκ² λ‹€λŠ” κ²λ‹ˆλ‹€. λ‹¨μˆœν•œ 숫자λͺ©λ‘μ΄λ‚˜ 기호λͺ©λ‘μ΄ μ‹«λ‹€λ©΄ 이걸 μ“Έ μˆ˜λ„ μžˆκ² λ„€μš”.

  • list-style λͺ©λ‘ κ΄€λ ¨ μŠ€νƒ€μΌμ„ ν•œκΊΌλ²ˆμ— μ •μ˜ν•  수 있게 ν•΄μ£ΌλŠ” 속성이죠.

  • marker-offset λͺ©λ‘μ—μ„œ 마컀(숫자, 동글라미 λ“±λ“±)와 ν…μŠ€νŠΈ μ‚¬μ΄μ˜ 간격을 κ²°μ •μ§“λŠ” μ†μ„±μž…λ‹ˆλ‹€.

이제 각 속성듀을 μ–΄λ–»κ²Œ μ‚¬μš©ν•˜λŠ”μ§€ 예제λ₯Ό ν•œλ²ˆ λ³ΌκΉŒμš”?? 


The list-style-type Property:

list-style-type 속성은 뭐 λͺ©λ‘μ— λ³΄μ—¬μ§€λŠ” 마컀의 μŠ€νƒ€μΌμ„ λ³€κ²½ν•˜κΈ°μœ„ν•œ μ†μ„±μž…λ‹ˆλ‹€. 

λͺ©λ‘μ—λŠ” 크게 μˆœμ„œμžˆλŠ” λͺ©λ‘κ³Ό μˆœμ„œμ—†λŠ” λͺ©λ‘μ΄ 있죠.

 

λ‹€μŒμ€ μˆœμ„œμ—†λŠ” λͺ©λ‘μ—μ„œ μ‚¬μš©ν•  수 μžˆλŠ” list-style-type의 μ†μ„±κ°’μž…λ‹ˆλ‹€. 

ValueDescription
noneNA
disc (default)A filled-in circle
circleAn empty circle
squareA filled-in square

 

λ‹€μŒμ€ μˆœμ„œμžˆλŠ” λͺ©λ‘μ—μ„œ μ‚¬μš©λ˜λŠ” μ†μ„±κ°’μž…λ‹ˆλ‹€. 

ValueDescriptionExample
decimalNumber1,2,3,4,5
decimal-leading-zero0 before the number01, 02, 03, 04, 05
lower-alphaLowercase alphanumeric charactersa, b, c, d, e
upper-alphaUppercase alphanumeric charactersA, B, C, D, E
lower-romanLowercase Roman numeralsi, ii, iii, iv, v
upper-roman Uppercase Roman numeralsI, II, III, IV, V
lower-greek The marker is lower-greek alpha, beta, gamma
lower-latin The marker is lower-latin a, b, c, d, e
upper-latin The marker is upper-latin A, B, C, D, E
hebrew The marker is traditional Hebrew numbering  
armenian The marker is traditional Armenian numbering  
georgian The marker is traditional Georgian numbering  
cjk-ideographicThe marker is plain ideographic numbers 
hiraganaThe marker is hiraganaa, i, u, e, o, ka, ki
katakanaThe marker is katakanaA, I, U, E, O, KA, KI
hiragana-irohaThe marker is hiragana-irohai, ro, ha, ni, ho, he, to
katakana-irohaThe marker is katakana-irohaI, RO, HA, NI, HO, HE, TO

 

 

예제λ₯Ό ν•œλ²ˆ λ³ΌκΉŒμš”. 

<ul style="list-style-type:circle;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ul>

<ul style="list-style-type:square;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ul>

<ol style="list-style-type:decimal;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ol>

<ol style="list-style-type:lower-alpha;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ol>

<ol style="list-style-type:lower-roman;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ol>

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€. 

  • Maths
  • Social Science
  • Physics
  • Maths
  • Social Science
  • Physics
  1. Maths
  2. Social Science
  3. Physics
  1. Maths
  2. Social Science
  3. Physics
  1. Maths
  2. Social Science
  3. Physics

 


The list-style-position Property:

list-style-position 속성은 bullet pointλ₯Ό ν¬ν•¨ν•˜λŠ” λ°•μŠ€μ˜ λ‚΄λΆ€ λ˜λŠ” μ™ΈλΆ€μ˜ μœ„μΉ˜λ₯Ό μ§€μ •ν•˜λŠ” μ†μ„±μž…λ‹ˆλ‹€.

ValueDescription
noneNA
insideIf the text goes onto a second line, the text will wrap underneath the marker. It will also appear indented to where the text would have started if the list had a value of outside.
outsideIf the text goes onto a second line, the text will be aligned with the start of the first line (to the right of the bullet).

 

λ‹€μŒ 예제λ₯Ό λ³΄μ‹œμ£ .

<ul style="list-style-type:circle; list-stlye-position:outside;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ul>

<ul style="list-style-type:square;list-style-position:inside;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ul>

<ol style="list-style-type:decimal;list-stlye-position:outside;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ol>

<ol style="list-style-type:lower-alpha;list-style-position:inside;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ol>

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€.

  • Maths
  • Social Science
  • Physics
  • Maths
  • Social Science
  • Physics
  1. Maths
  2. Social Science
  3. Physics
  1. Maths
  2. Social Science
  3. Physics

 


The list-style-image Property:

list-style-image 속성은 μœ„μ—μ„œ λ§μ”€λ“œλ¦° κ²ƒμ²˜λŸΌ 이미지 νŒŒμΌμ„ μ†ŒμŠ€λ‘œ μ§€μ •ν•˜μ—¬ λͺ©λ‘μ˜ 마컀둜 μ‚¬μš©ν•  수 μžˆκ²Œλ” ν•΄μ£ΌλŠ” μ†μ„±μž…λ‹ˆλ‹€.  

 

λ‹€μŒ 예제λ₯Ό λ³΄μ‹œμ£ .

<ul>
<li style="list-style-image: url(/images/bullet.gif);">Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ul>

<ol>
<li style="list-style-image: url(/images/bullet.gif);">Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ol>

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€. ( url에 μ–΄λ–€ 이미지 μ†ŒμŠ€μ˜ κ²½λ‘œκ°€ λ“€μ–΄κ°€λŠλƒμ— 따라 λ‹¬λΌμ§€λŠ” κ²°κ³Όμž…λ‹ˆλ‹€. ) 

  • Maths
  • Social Science
  • Physics
  1. Maths
  2. Social Science
  3. Physics

 


The list-style Property:

λ‹€μŒ 예제λ₯Ό λ³΄μ‹œμ£ . 

<ul style="list-style: inside square;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ul>

<ol style="list-style: outside upper-alpha;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ol>

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€.

  • Maths
  • Social Science
  • Physics
  1. Maths
  2. Social Science
  3. Physics

 


The marker-offset Property:

이 속성은 IE 6, Netscape 7 μ΄ν•˜μ—μ„œλŠ” μ§€μ›ν•˜μ§€ μ•ŠλŠ”λ‹€λŠ”κ΅°μš”.

예제λ₯Ό λ΄…μ‹œλ‹€. 

<ul style="list-style: inside square; marker-offset:2em;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ul>

<ol style="list-style: outside upper-alpha; marker-offset:2cm;">
<li>Maths</li>
<li>Social Science</li>
<li>Physics</li>
</ol>

 

κ²°κ³ΌλŠ” μ•„λž˜μ™€ κ°™μŠ΅λ‹ˆλ‹€.

  • Maths
  • Social Science
  • Physics
  1. Maths
  2. Social Science
  3. Physics

 

 

 

 

 

Reference : http://www.tutorialspoint.com/css/css_lists.htm