본문 바로가기
카테고리 없음

[CSS] CSS 기초 개념 모음

by cook_code 2023. 2. 16.
반응형

1. width: 100px; max-width / min-width : 요소의 가로 너비


2. height: 100px; max-height / min-height : 요소의 세로 너비


3. margin-top: 20px; margin-top / margin-bottom / margin-left / margin-right : 요소의 외부(바깥) 여백


4. padding-top: 20px; padding-top / padding-bottom / padding-left / padding-right: 요소의 내부(안쪽) 여백

5. border: 4px solid red; : 요소의 테두리 선


6. border-radius: 10px : 요소의 모서리 둥글게 (50%: 동그라미)


7. box-shadow: 4px 4px 10px rgba(0,0,0,0.5); : 요소의 그림자


8. font-size: 16px; : 글꼴의 크기


9. font-weight: 700; : 글꼴의 두께 (100-900), (보통400, 굵게900)


10. font-family: "나눔고딕", sans-serif; : 글꼴의 이름 및 종류 지정


11. line-height: 1.4; : 글꼴의 줄 높이 (폰트 사이즈의 1.4배)


12. color: red; : 문자 색상


13. text-align: center; : 문자 정렬


14. text-decoration: underline; text-decoration: none; : 문자 꾸미기 밑줄 추가/밑줄 제거


15. word-break: keep-all; : 한글에서 띄어쓰기로 단어 구분


16. background-color: blue; :요소의 배경 색상


17. background-image: url("이미지_경로"); : 요소의 배경 이미지


18. background-size: 100px; : 요소의 배경 이미지 크기


19. background-repeat: no-repeat; : 요소의 배경 이미지 반복 없음


20. background-position: top center; : 요소의 배경 이미지 위치 (top, bottom, left, right, center)


21. display: flex; justify-content: center; align-items: center;

: 요소의 자식 요소들을(수평) 정렬, 정렬(flex)된 요소들의 수평 / 수직 전체 정렬


22. transform: translateX(10px) translateY(20px) scale(1.2) rotate(45deg);

: 요소의 변환 효과, x축 이동/y축 이동/비율 크기/회전


23. transition: 1s; 요소의 전환 효과


24. @media (max-width: 500px){ 선택자{속성:값;}}

: 미디어쿼리(미디어규칙), 브라우저 화면의 크기에 맞게 css 새롭게 지정

반응형