html, css

[css] 속성 이해하기_6-6, 6-7, 6-8

줌인. 2023. 8. 4. 08:51

*예제 코드1 (스스로 해석 해보기)

.welcome-header{
    margin-top:57px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-weight: 800;  
}

.welcome-header__title {
    margin-bottom:18px;
}

.welcome-header__text {
    margin-bottom:57px;
    width: 50%;
    opacity: 0.7;}

1. margin : white 화면 공백 자체의 가장 큰 가장자리

2. align -items:center;  > 가장자리에 오는 이유는 'flex-direction'

3. display : flex; 를 사용하는 이유 > Header 자체가 모두 정렬되어야 할 레이아웃 요소
     ex) header, h1, p 자체 요소가 모두 가운데로 와야함 > 해당 요소들의 모든 공통점이 Header class로 통용되기 때문

※ 반응형 디자인, 정렬/공간 분배에 사용된다.

 

 

*예제 코드2 (스스로 해석 해보기)

#login-form{
    display: flex;
    flex-direction: column;
    margin: 0px 30px;
}

#login-form input {
    border:none;
    padding:10px 0px;
    font-size: 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    transition: border-color 0.3s ease-in-out}

#login-form input::placeholder {
    color:rgba(0, 0, 0, 0.4);
}

#login-form input:focus {
    border-color:var(--skysky);
}

1) 로그인 폼 자체 카테고리를 정렬

2) 로그인 폼 내 input 요소에 부여할 것 확인

    -  글자와 경계선의 폭, 글자 사이즈, 아래 선 표시 방법

3) transition : state에 따라 바뀌는 property가 있어야 함

    - transition을 부여하고 아래의 input:focus가 실행되는 이러한 내용이 있어야 실행이 되는 것

    - input의 

4) :: placeholder

 

<transition>

타이밍(Easing) 함수 종류 효과
ease-in 느리게 출발하다가 점점 빨라짐
ease-out 빠르게 출발하다가 점점 느려짐
ease-in-out 느려졌다가 보통이었다가 느려짐
linear easing 하지 않고 일정함

<input:hover, active, focus>

구분 효과
hover 마우스가 올라갔을 때
focus 선택된 상태가 되었을 때
active 클릭 됐을 때 (활성화)

 

https://matthewlein.com/tools/ceaser

 

Ceaser - CSS Easing Animation Tool - Matthew Lein

Choose an easing type and test it out with a few effects. If you don’t quite like the easing, grab a handle and fix it. When you’re happy, snag your code and off you go. Now that we can use CSS transitions in all the modern browsers, let’s make them

matthewlein.com

https://animista.net/

 

Animista - On-Demand CSS Animations Library

Animista is a CSS animation library and a place where you can play with a collection of ready-made CSS animations and download only those you will use.

animista.net

https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries

 

Using media queries - CSS: Cascading Style Sheets | MDN

Media queries allow you to apply CSS styles depending on a device's general type (such as print vs. screen) or other characteristics such as screen resolution or browser viewport width. Media queries are used for the following:

developer.mozilla.org

 

참고 블로그 : https://poiemaweb.com/css3-transition

 

CSS3 Transition | PoiemaWeb

트랜지션(transition)은 CSS 프로퍼티 변경에 따른 표시의 변화를 부드럽게 하기 위해 애니메이션 속도를 조절한다. 즉, 프로퍼티 변경이 표시의 변화에 즉시 영향을 미치게 하는 대신 그 프로퍼티

poiemaweb.com

 

https://matthewlein.com/tools/ceaser

 

Ceaser - CSS Easing Animation Tool - Matthew Lein

Choose an easing type and test it out with a few effects. If you don’t quite like the easing, grab a handle and fix it. When you’re happy, snag your code and off you go. Now that we can use CSS transitions in all the modern browsers, let’s make them

matthewlein.com

https://animista.net/

 

Animista - On-Demand CSS Animations Library

Animista is a CSS animation library and a place where you can play with a collection of ready-made CSS animations and download only those you will use.

animista.net

https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries

 

Using media queries - CSS: Cascading Style Sheets | MDN

Media queries allow you to apply CSS styles depending on a device's general type (such as print vs. screen) or other characteristics such as screen resolution or browser viewport width. Media queries are used for the following:

developer.mozilla.org

 

참고 블로그 : https://poiemaweb.com/css3-transition

 

CSS3 Transition | PoiemaWeb

트랜지션(transition)은 CSS 프로퍼티 변경에 따른 표시의 변화를 부드럽게 하기 위해 애니메이션 속도를 조절한다. 즉, 프로퍼티 변경이 표시의 변화에 즉시 영향을 미치게 하는 대신 그 프로퍼티

poiemaweb.com

 

*예제 코드3 (스스로 해석 해보기)

#login-form input:not([type="submit"]){
    border-bottom: 1px solid rgba(0,0,0,0.4);
    transition: border-color 0.3s ease-in-out;}
   
#login-form input {
    padding:10px 0px;
    font-size: 18px;
    margin-bottom: 20px;
    border:none;}

#login-form input::placeholder {s
    color:rgba(0, 0, 0, 0.4);}

#login-form input:focus {
    border-color:tomato;}

#login-form input[type="submit"] {
    background-color: yellow;
    cursor: pointer;
    border-radius: 5px;}

 

1) [ ] : 요소를 대상으로 지정하는 것

    { } : 요소의 스타일을 지정하는 것

2) input:not이 의미하는 것은 not을 제외한 모든 것에서 적용된다는 의미임_때문에 중복 적용하면 안됨

3) css cascading을 유의할 것(우선순위 법칙)

    - not이 transition 발동 전 보다 위에 있어야함, 위에서부터 아래로 적용되는 구조에 따르면 border none에서 시작

     (즉 border 자체가 없는 상황에서 색을 설정해도 적용될 수 없음)

4) color : inherit의 의미는 anchor(자식) 의 색상을 login-form(아버지)에서 상속 받는다는 의미

5) cursor의 종류 (https://cofs.tistory.com/212)

 

**전체 코드 혼자 작성해보기

.welcome-header{
    margin-top:90px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-weight:bolder;}

.welcome-header__title{
    margin-bottom: 30px;}

.welcome-header__text {
    margin-bottom: 80px;
    width: 50%;
    opacity: 0.7;}

#login-form{
    display: flex;
    flex-direction: column;
    margin: 0px 30px;}

#login-form input:not([type="submit"]){
    border-bottom: 1px solid rgba(0,0,0,0.4);
    transition: border-color 0.3s ease-in-out;}
   
#login-form input {
    padding:10px 0px;
    font-size: 18px;
    margin-bottom: 20px;
    border:none;}

#login-form input::placeholder {s
    color:rgba(0, 0, 0, 0.4);}

#login-form input:focus {
    border-color:tomato;}

#login-form input[type="submit"] {
    background-color: yellow;
    cursor: pointer;
    border-radius: 5px;}

 

728x90