'2020/CSS'에 해당되는 글 30건

@media

2020/CSS 2020. 3. 25. 17:14
반응형

@media 미디어타입 and (미디어 특성){ css코드 }

 

미디어 타입

all :모든 미디어 타입에 적용

screen: 컴퓨터 화면, 타블렛, 스마트폰

print: 인쇄 전용

 

미디어 특성

width 뷰포트 가로 너비

max-width 뷰포트 최대 가로 너비(이하)

min-width 뷰포트 최소 가로 너비(이상)

height 뷰포트 세로 너비

max-height 뷰포트 최대 세로 너비(이하)

min-height 뷰포트 최소 세로 너비(이상)

orientation 뷰포트 방향(portrait, landscape) portrait(세로가 더 긴 상태) landscape(가로가 더 긴 상태)

 

<div class="container"><div>

<style>
.container{
width: 100px;
height: 100px;
background: red;
}

/* 최소 너비가 700px 이상이면 css적용 */
@media screen and (max-width: 700px){
.container{
height: 300px;
background: blue;
	}
}

</style>
반응형

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

flex  (0) 2020.03.24
css 다단  (0) 2020.03.24
animation-play-state  (0) 2020.03.24
animation-fill-mode  (0) 2020.03.24
animation-iteration-count, animation-direction  (0) 2020.03.24
블로그 이미지

꽃꽂이하는개발자

,

flex

2020/CSS 2020. 3. 24. 21:19
반응형

# 컨테이너자체가 block이 되느냐 아니면 inline형태의 block이 되느냐의 차이

display : inline-flex;

display: flex;

 

#flex-direction

row : items를 수평축으로 표시

row-reverse: items를 row의 반대 축으로 표시

column: items를 수직축으로 표시

column-reverse: items를 column의 반대축으로 표시

ex) flex-direction: row

 

#

flex-start : 시작점

flex-end: 끝점

 

#flex-wrap

nowrap: 모든 items를 여러 줄로 묶지 않고 한줄에 표시

wrap : items를 여러 줄로 묶음

wrap-reverse: items를 wrap의 역방향 묶음

 

#justify-content: 주측의 정렬방법

flext-start;

flex-end;

center;

space-between;

space-around;

 

#align-content: 교차측의 정렬방법

stretch;

flext-start;

flex-end;

center;

space-between;

space-around;

 

#align-items

stretch;

flext-start;

flex-end;

center;

baseline; 아이템을 문자 기준선에 정렬

 

#flex-grow: 증가너비;

ex) flex-grow: 1; 비율에 따라 크기 변경

 

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .container {
        border: 2px solid red;
        display: flex;
      }
      .container .item {
        height: 100px;
        border: 2px solid;
        border-radius: 10px;
      }
      .item1 {
        flex-grow: 1;
      }
      .item2 {
        flex-grow: 2;
      }
      .item3 {
        width: 100px;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="item item1">1</div>
      <div class="item item2">2</div>
      <div class="item item3">3</div>
    </div>
  </body>
</html>

#flex-shrink : item이 감소하는 너비의 비율을 설정합니다.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .container {
        border: 2px solid red;
        display: flex;
      }
      .container .item {
        height: 100px;
        border: 2px solid;
        border-radius: 10px;
      }

      .item1 {
        flex-basis: 200px;
        flex-shrink: 1;
      }
      .item2 {
        flex-basis: 200px;
        flex-shrink: 2;
      }
      .item3 {
        width: 100px;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="item item1">1</div>
      <div class="item item2">2</div>
      <div class="item item3">3</div>
    </div>
  </body>
</html>

# flex-basis : item의 공간 배분 전 기본 너비를 설정합니다.

 

반응형

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

@media  (0) 2020.03.25
css 다단  (0) 2020.03.24
animation-play-state  (0) 2020.03.24
animation-fill-mode  (0) 2020.03.24
animation-iteration-count, animation-direction  (0) 2020.03.24
블로그 이미지

꽃꽂이하는개발자

,

css 다단

2020/CSS 2020. 3. 24. 12:40
반응형

columns: 폭 다단개수

  • column-width
  • column-count

column-gap : 다단사이 간격

 

column-rule:  두께 종류 색상

  • column-width: 선의 두께 지정
  • column-style: 선의 종류 지정
  • column-color: 선의 색상을 지정
반응형

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

@media  (0) 2020.03.25
flex  (0) 2020.03.24
animation-play-state  (0) 2020.03.24
animation-fill-mode  (0) 2020.03.24
animation-iteration-count, animation-direction  (0) 2020.03.24
블로그 이미지

꽃꽂이하는개발자

,

animation-play-state

2020/CSS 2020. 3. 24. 12:21
반응형
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .box {
        width: 100px;
        height: 100px;
        background: blueviolet;
        margin: 10px;
        animation: move 2s linear infinite alternate;
        display: flex;
        justify-content: center;
        align-items: center;
      }

      .box::before {
        content: "running";
        font-size: 25px;
        color: white;
        font-weight: 800;
      }
      .box:hover {
        animation-play-state: paused;
        background: dodgerblue;
      }
      .box:hover::before {
        content: "paused";
      }

      @keyframes move {
        0% {
          width: 100px;
        }
        100% {
          width: 500px;
        }
      }
    </style>
  </head>
  <body>
    <div class="box"></div>
  </body>
</html>

animation-play-state:

run : 작동

paused: 정지

 

반응형

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

flex  (0) 2020.03.24
css 다단  (0) 2020.03.24
animation-fill-mode  (0) 2020.03.24
animation-iteration-count, animation-direction  (0) 2020.03.24
animation-timing-function  (0) 2020.03.24
블로그 이미지

꽃꽂이하는개발자

,

animation-fill-mode

2020/CSS 2020. 3. 24. 12:14
반응형
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .box {
        width: 100px;
        height: 100px;
        background: blueviolet;
        margin: 10px;
        animation: move 2s 2s;
        /* 함수 실행시간 딜레이시간*/
        
        /* animation-fill-mode : 애니메이션의 전후 상태(위치)를 설정 
        none: 기존위치에서 시작하고 애니메이션 시작 위치로 이동- 동작- 기존위치에서 끝
        forwards: 기존위치 -> 애니메이션 시작위치 > 동작 > 애니메이션 끝위치에서 끝
        backwards: 애니메이션 시작위치 시작 -> 동작 -> 기존위치에서 끝
        both: 애니메이션 시작 위치에서 시작 -> 동작 -> 애니메이션 끝 위치에서 끝
        */
        animation-fill-mode: both;
        
      }
      @keyframes move {
        0% {
          transform: translate(100px, 100px);
          background: dodgerblue;
        }
        100% {
          transform: translate(300px, 100px);
          background: coral;
        }
      }
    </style>
  </head>
  <body>
    <div class="box"></div>
  </body>
</html>
반응형

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

css 다단  (0) 2020.03.24
animation-play-state  (0) 2020.03.24
animation-iteration-count, animation-direction  (0) 2020.03.24
animation-timing-function  (0) 2020.03.24
@keyframes  (0) 2020.03.24
블로그 이미지

꽃꽂이하는개발자

,
반응형

animation-iteration-count: 반복 횟수 ex) 1, 2, infinite;

 

animation-direction : 애니메이션의 반복방향을 설정

     normar: 정방향

     reverse : 역방향

     alternate : 정방향에서 역방향으로 반복(왕복)

     alternate-reverse: 역방향에서 정방향으로 반복(왕복)

 

반응형

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

animation-play-state  (0) 2020.03.24
animation-fill-mode  (0) 2020.03.24
animation-timing-function  (0) 2020.03.24
@keyframes  (0) 2020.03.24
CSS: transform 3D 변환 함수  (0) 2020.03.23
블로그 이미지

꽃꽂이하는개발자

,

animation-timing-function

2020/CSS 2020. 3. 24. 11:57
반응형
ease 빠르게 - 느리게 cubic-bezier( .25, .1, .25, ,1)
linear 일정하게 cubic-bezier(0, 0, 1, 1)
ease-in 느리게 - 빠르게 cubic-bezier(.42, 0, 1, 1)
ease-out 빠르게 - 느리게 cubic-bezier(0, 0, .58, 1)
ease-in-out 느리게 - 빠르게 - 느리게 cubic-bezier(0, 0, .58, 1)
cubic-beier(n, n, n, n) 자신만의 값을 정의  
steps(n) n번 분할된 애니메이션  
     

 

animation-delay : 대기시간 (음수 값도 허용)

 

.box:hover{
animation: size-up 1s 2 alternate linear 0s;
/* animation-timing-function: linear;
animation-delay; */
}

@keyframes size-up{
0%{ width: 100px;}
100% {width: 500px;}
}
반응형

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

animation-fill-mode  (0) 2020.03.24
animation-iteration-count, animation-direction  (0) 2020.03.24
@keyframes  (0) 2020.03.24
CSS: transform 3D 변환 함수  (0) 2020.03.23
CSS : transform 2D 변형효과  (0) 2020.03.23
블로그 이미지

꽃꽂이하는개발자

,

@keyframes

2020/CSS 2020. 3. 24. 11:46
반응형

2개 이상의 애니메이션 중간 상태(프레임)을 지정할 때 사용합니다.


/*
@keyframes name{
0%{ 속성 : 값 }
50% { 속성 : 값}
100%{ 속성 : 값}
}
*/

@keyframes moveBox{
0% { left : 100px;}
100% { top: 200px;}
}

 

.box{
width: 100px;
height: 100px;
background : blue;
}

.box:hover{
animation: myAni 3s infinite alternate;
/*
animation-name: myAni;
animation-duration: .3s;
*/
@keyframes myAni{
0% { width : 100px;
background: yellowgreen;} 
100% { width: 300px;
background: red}
}
반응형

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

animation-iteration-count, animation-direction  (0) 2020.03.24
animation-timing-function  (0) 2020.03.24
CSS: transform 3D 변환 함수  (0) 2020.03.23
CSS : transform 2D 변형효과  (0) 2020.03.23
text-indent  (0) 2020.03.23
블로그 이미지

꽃꽂이하는개발자

,