Notice
                              
                          
                        
                          
                          
                            Recent Posts
                            
                        
                          
                          
                            Recent Comments
                            
                        
                          
                          
                            Link
                            
                        
                    | 일 | 월 | 화 | 수 | 목 | 금 | 토 | 
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 | 
| 12 | 13 | 14 | 15 | 16 | 17 | 18 | 
| 19 | 20 | 21 | 22 | 23 | 24 | 25 | 
| 26 | 27 | 28 | 29 | 30 | 31 | 
                            Tags
                            
                        
                          
                          - 시스템 파악
- springboot
- Bandit Level 5
- plsql
- 클린코드
- avax.net.ssl.SSLHandshakeException:
- was SQLRecoverableException
- vue
- 인증서만료에러
- 디미터 법칙
- CSS
- OpenAPI
- 나선형 모형
- 폭포수 모형
- Bandit Level 6
- 커맨드공부
- Bandit Level 6 → Level 7
- pl/sql
- mysql 튜닝
- 에자일 모형
- java.sql.SQLRecoverableException
- Law of Demeter
- 변수명 짓는법
- 프로토타입 모형
- table scan
- was버그
- SQLRecoverableException
- 명령어공부
- 스크럼기법
- 시스템 파악 정리
                            Archives
                            
                        
                          
                          - Today
- Total
개발햄비
[CSS] Pseudo Selector 정리 본문
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Selectors and Pseudo Selectors</title>
  <style>
    input[type="submit"]{
      background-color: red;
    }
    input{
      border: 1px solid yellow;
    }
    .box{
      background-color: green;
      display: block;
      height: 100px;
      border: 1px solid black;
    }
     /* 첫번째 자식*/
    .box:first-child{
      background-color: yellow;
    }
     /* n번째 자식*/
    .box:nth-child(2n){
      background-color: gold;
    }
    /* 마지막 자식*/
    .box:last-child{
      background-color: pink;
    }
    /* 형제 */
    input + .box{
      background-color: pink;
    }
    .box > .box{
      /* 직계 */
      background-color: yellowgreen;
      width: 100px;
    }
  </style>
</head>
<body>
<div class="test">
  <div class="box">1
    <div class="box">1-1</div>
  </div>
  <div class="box">2</div>
  <div class="box">3
    <input type="text" >3-1
    <input type="submit">3-2
  </div>
  <div class="box">4</div>
  <div class="box">5</div>
  <div class="box">6</div>
</div>
</div>
</body>
</html>

'개발 > CSS' 카테고리의 다른 글
| [CSS] 세로 오픈 메뉴 예제 (0) | 2019.09.08 | 
|---|---|
| [CSS] display: block 과 inline-block 그리고 inline 차이 (0) | 2019.09.07 | 
 
                  