일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- 자바스트립트
- 자바스크립트
- 클래스
- webdevelopment
- frontend
- 노마드코더
- Fetch
- CSS
- 추상화
- 리액트
- OOP
- 불변성
- typeScript
- 논리연산자
- js
- 타입스크립트
- Zustand
- Hooks
- 캡슐화
- 상속
- 웹개발
- REACT
- 투두앱만들기
- 프론트엔드
- github
- JavaScript
- 패스트캠퍼스
- 객체지향프로그래밍
- 부트캠프
- Props
Archives
- Today
- Total
connecting dots
HTML/CSS 3회차 | CSS 기초, flex, grid, 미디어 쿼리, CSS 네이밍 방법론, css framework 본문
Live Class/DevCamp
HTML/CSS 3회차 | CSS 기초, flex, grid, 미디어 쿼리, CSS 네이밍 방법론, css framework
dearsuhyun 2024. 6. 15. 15:29
사이트
flex
<div class="container">
<div class="box">1</div>
<div class="box">2</div>
<div class="box">3</div>
<div class="box">4</div>
<div class="box">5</div>
<div class="box">6</div>
<div class="box">7</div>
div {
font-size: 20px;
border: 1px solid gray;
}
.container {
display: flex;
background-color: red;
}
.box {
background-color: white;
}
flex(flex-grow, flex-basis, flex-shrink의 축약형)
flex-grow : 남은 영역이 있으면 그것을 각각 자식들에게 나눠 줄거야 (커질 때 얼마나 커질건지)
flex-shrink: 축소. 자식을 배치할 공간이 부족할 때는 자식 크기를 줄여야 함. 줄이는 비율
--> 알아서 줄이거나 키워줄게 ! flex
flex-basis: 아무것도 안 했을 때 자식요소 크기 (default = 0)
div {
font-size: 20px;
border: 1px solid gray;
}
.container {
display: flex;
background-color: red;
}
.box {
flex: 1;
background-color: white;
}
flex의 합은 7, 각자가 flex:1 로 1개씩 가지니까 똑같은 크기로 !
direction
flex-direction: row; 수평
flex-direction: column; 수직
flex-direction: column-reverse;
direction: ltr;
direction: rtl;
정렬 (justify-content)
https://developer.mozilla.org/ko/docs/Web/CSS/justify-content
main 축을 기준으로 정리됨
main --> direction이랑 같음
cross(교차축) direction의 반대
align-items: stretch, center, start, end;
https://developer.mozilla.org/ko/docs/Web/CSS/align-items
grid
https://developer.mozilla.org/en-US/docs/Web/CSS/grid
미디어 쿼리
조건 유형 학습하기 (width, orientation 등)
https://developer.mozilla.org/ko/docs/Learn/CSS/CSS_layout/Media_queries
@media media-type and (media-feature-rule) {
/* CSS rules go here */
}
페이지가 인쇄된 경우에만 본문을 12pt로 설정
@media print {
body {
font-size: 12pt;
}
}
미디어 쿼리 테스트 사이트
CSS 전처리기 (SCSS)
variable
scss
$font-stack: Helvetica, sans-serif;
$primary-color: #333;
body {
font: 100% $font-stack;
color: $primary-color;
}
--> css
body {
font: 100% Helvetica, sans-serif;
color: #333;
}
Nesting(중첩)
scss
nav {
ul {
margin: 0;
padding: 0;
list-style: none;
}
li { display: inline-block; }
a {
display: block;
padding: 6px 12px;
text-decoration: none;
}
}
css (중첩 지원하지 않음)
nav ul {
margin: 0;
padding: 0;
list-style: none;
}
nav li {
display: inline-block;
}
nav a {
display: block;
padding: 6px 12px;
text-decoration: none;
}
Modules
scss
// _base.scss
$font-stack: Helvetica, sans-serif;
$primary-color: #333;
body {
font: 100% $font-stack;
color: $primary-color;
}
// styles.scss
@use 'base';
.inverse {
background-color: base.$primary-color;
color: white;
}
css
body {
font: 100% Helvetica, sans-serif;
color: #333;
}
.inverse {
background-color: #333;
color: white;
}
CSS 네이밍 방법론
BEM
보통 면접용 ? 실무에서는 잘 쓰이지 않음 (?)
Atomizer
css framework
https://blueprintjs.com/docs/#blueprint
참고 사이트
반응형
'Live Class > DevCamp' 카테고리의 다른 글
JS 6회차 | 토이 프로젝트 설명, import/export, axis, express, app.get, SQL (0) | 2024.06.16 |
---|---|
JS 1회차 | 식, 값, 문, 실행(run), 변수를 만드는 방법, 메커니즘, 객체의 특징, 함수를 만드는 방법 (0) | 2024.06.15 |
HTML/CSS 2회차 | CSS 기초, box model, flexbox (0) | 2024.06.14 |
HTML/CSS 1회차 | html 기초, DOM (1) | 2024.06.14 |
JS 2회차 | 함수: 일급함수, 즉시실행함수, 화살표함수, 클래스, 메소드, scope, var/let/const, 복사와 참조 (0) | 2024.06.14 |