본문 바로가기

css - 정렬 본문

개발/HTML CSS

css - 정렬

자전하는명왕성 2022. 12. 21. 20:58

몸살기운이 도졌는데, 생각보다 어렵지 않은 개념이라 다행이었다.

 

 

.container p:First-of-type => class 'container' 안의 첫번째 p태그

 

Nth-of-type(n)

 

Flex-wrap : wrap 자연스러운 줄갈이

 

Align-items 는 flex-item이 한줄일 때 우선적용

두줄 이상일 때는 align-content 사용

 

Flex-flow : flex-direction 과 flex-wrap을 합쳐놓은 단축 속성

Ex) flex-flow : column wrap

 

Line-height 텍스트의 행간 설정

 

Letter-spacing 텍스트의 자간을 설정

 

Text-indent 들여쓰기

 

단위

  1. 절대단위 px pt(인쇄를 위한 단위)
  2. 상대단위 % em(font-size 속성값에 비례해서 값을 결정) rem(font-size 최상위 속성값에 비례)

 

스프린트

 

 

   <div class="wrapper">
        <div class="box white">White</div>
        <div class="box yellow">Yellow</div>
        <div class="box green">Green</div>
        <div class="box yellow">Yellow</div>
        <div class="box green">Green</div>
        <div class="box white">White</div>
    </div>
    
    --
    
    * {
    box-sizing: border-box;
    margin: 0px;
}
body {
    display: flex;
    flex-direction: row;
    justify-content: center;
    margin: 50px 0px;
}
.wrapper {
    width: 1000px;
    height: 675px;
    background-color: red;
    display: flex;
    flex-flow: row wrap;
    justify-content: space-evenly;
    align-content: space-evenly;
}
.box {
    width: 300px;
    height: 300px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    font-style: italic;
    font-size: 50px;
}
.white {
    background-color: white;
    color: black;
}
.yellow {
    background-color: yellow;
    color: red;
}
.green {
    background-color: green;
    color: white;
}

'개발 > HTML CSS' 카테고리의 다른 글

css - 그리드 / 반응형 웹  (0) 2022.12.23
CSS - transform / animation  (0) 2022.12.22
css - cascading / background / transition  (1) 2022.12.21
css - 선택자(child, nth) / 정렬  (0) 2022.12.21
HTML - 기초지만 얕은 개념  (0) 2022.12.21
Comments