
inline
block
inline-block
display: inline-block;
display none
visibility hidden
none : 원래 요소의 특징 (block이면 block 특징, inline이면 inline 특징)left : 글의 왼쪽에 위치right : 글의 오른쪽에 위치normal flow
position: relative
position: absolute
float처럼)⚠ 조상 중에서 position이 static이 아닌 요소를 찾아 기준점을 삼음
position: fixed
position: sticky
fixed처럼 고정되어 보임visible : 크기에 상관없이 내용이 모두 보임hidden : 요소 크기를 벗어나면 벗어나는 요소는 보이지 않음scroll : 요소 안에 scroll이 생김auto : 넘치지 않을 때에는 visible, 넘치는 경우 scroll을 적용한 것과 같음auto : 기본 순서정수값 : 정수 값이 클 수록 위에 뜨게 됨HEX
#ffffff : 각각 R G B가 2개씩 16진수로 작성됨rgb
rgb(12, 130, 250) : 각각 R G Brgba
rgba(12, 50, 85, 0.8) : rgb + 투명도(0~1의 값)background-color
background-image
background-image: url("image url");
background-repeat
background-image: url("image url");
background-repeat: repeat;
background-repeat: repeat-x;
background-repeat: repeat-y;
background-repeat: no-repeat;
background-position
background-image: url("image url");
background-repeat: no-repeat;
/* 시작하는 위치를 지정할 수 있음 ➡ 반복일 경우, 그 지점부터 주변 방향으로 배치 */
background-position: x좌표 y좌표;
/* 키워드로 사용할 수도 있음 ➡ right left top bottom center */
background-origin
background-origin: content-box;
/* padding 안쪽으로 위치 */
background-origin: padding-box;
/* padding 부터 위치 ✔기본값✔ */
background-origin: border-box;
/* border 부터 위치 */
background-size
auto (이미지의 원래 크기)contain : 이미지가 잘리거나 찌그러지지 않는 한도 내에서 제일 크게 설정, 비율 유지cover : 이미지가 찌그러지지 않는 한도 내에서 제일 크게 설정 (빈 공간이 생기지 않도록 !), 비율 유지length : 직접 값 설정100% : 가로에 맞춰 꽉 채움 (빈 공간 생길 수 있음)background (shorthand)
⚠ 주의 사항
- color는 맨 마지막에 위치해야 함
- size 값은 position 바로 뒤에만 위치할 수 있음 ➡
position / size형태로 구분
transform 하나scale(num) 또는 scale(num, num)transform: scale(0.4, 0.8)
/* 값을 하나만 입력할 경우, x와 y에 동일하게 적용됨 */
transform: scalex(0.3)
transform: scaley(1)deg : 각도turn : 1 turn == 한 바퀴% 로 입력한 값은 이미지 크기의 비율transform: translate(0.4, 0.8)
/* 값을 하나만 입력할 경우, x값만 설정, y값은 0이 됨 */
transform: translatex(0.3)
transform: translatey(1)
transform: skew(40deg, 80deg)
/* 값을 하나만 입력할 경우, x값만 설정, y값은 0이 됨 */
transform: skewx(30deg)
transform: skewy(10deg)
% px top 등으로 설정할 수 있음transform-origin: top left;
transition-property
all : 모든 속성값에 대해 변경특정값 : 해당 값에 대해서만 변경transition-duration
s : 1초ms : 1s==1000ms.box {
background-color: yellow;
transition-property: all;
/* property에 추가하지 않은 다른 속성들은 시간이 적용되지 않음 */
transition-duration: 2s;
/* 변경하고 싶은 곳에 작성 */
}
.box:hover{
background-color: red;
}
transition-delay
.box {
background-color: yellow;
transition-property: all;
/* property에 추가하지 않은 다른 속성들은 시간이 적용되지 않음 */
transition-duration: 2s;
/* 변경하고 싶은 곳에 작성 */
transition-delay: 1s;
/* 1초 뒤에 변경 */
}
.box:hover{
background-color: red;
}
transition-timing-function
.box {
background-color: yellow;
transition-property: all;
/* property에 추가하지 않은 다른 속성들은 시간이 적용되지 않음 */
transition-duration: 2s;
/* 변경하고 싶은 곳에 작성 */
transition-timing-function: ease-out;
/* 처음에는 빠르게, 나중에는 느리게 */
}
.box:hover{
background-color: red;
}
transition (shorthand)