Internet/CSS

CSS :last-child

by 1730 2014. 2. 13.

:last-child 선택자는 요소중에 마지막 요소에 별도의 속성을 정의할 수 있습니다.

 

:last-child {  }

 

 

기본값:없음, 상속:안됨, 버전:CSS3

 

  • 첫째
  • 둘째
  • 셋째
  • 넷째
  • 다섯째
  • 여섯째
<ul class="demo_ul">
    <li class="demo">첫째</li> 
    <li class="demo">둘째</li> 
    <li class="demo">셋째</li>
    <li class="demo">넷째</li>
    <li class="demo">다섯째</li> 
    <li class="demo">여섯째</li>  
<style>
li:last-child     { font-size:20px; color:#f40; } 
or
ul > :last-child  { font-size:20px; color:#f40; } 
</style>

CSS :first-child

'Internet > CSS' 카테고리의 다른 글

CSS 긴글 말줄임 처리하는 방법  (0) 2019.01.21
텍스트 세로 가운데 정렬하는 몇 가지 방법  (0) 2018.12.26
CSS Links  (0) 2014.10.15
CSS line-height  (0) 2014.02.13
CSS :first-child  (0) 2014.02.13
CSS :first-line  (0) 2014.02.13
CSS :first-letter  (0) 2014.02.12
CSS z-index  (0) 2014.02.11