갈푸라떼
갈푸라떼는 개발중
갈푸라떼
전체 방문자
오늘
어제
  • 분류 전체보기 (232)
    • CS (0)
      • CSinfo (0)
    • Frontend (15)
      • HTML,CSS (1)
      • Javascript (2)
      • React (0)
      • React Hook (12)
    • Backend (0)
      • Python (0)
      • Node.js (0)
      • php (0)
    • DB (2)
      • MySQL (2)
      • BigQuery (0)
      • Mongodb (0)
    • Study (186)
      • JavaScript (72)
      • JavaScript(Clean code) (50)
      • Node.js (11)
      • HTML,CSS (13)
      • React (30)
      • TypeScript (10)
      • React-Native (0)
    • Error (2)
      • error (2)
    • Git (22)
      • Git (22)
    • Help Coding (4)
      • Useful websites (3)

블로그 메뉴

  • 홈
  • 태그
  • 방명록
  • Github

공지사항

인기 글

태그

  • prototype
  • 원시타입
  • 자바스크립트엔진
  • class
  • SPREAD
  • this
  • function
  • structure
  • Arrow
  • 네이밍
  • 렉시컬 환경
  • 컴파일러
  • ECMAScript
  • 실행 컨텍스트
  • 인터프리터
  • nodemon
  • 호이스팅
  • 상속
  • 심볼
  • 정적 레벨
  • 스코프 체인
  • PM2
  • symbol
  • 싱글스레드
  • 오버라이딩
  • 프로토타입
  • 객체타입
  • 함수
  • 이터러블
  • Babel

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
갈푸라떼

갈푸라떼는 개발중

Study/HTML,CSS

[CSS_study] display : grid_3 (Line Naming)

2022. 5. 14. 02:13

* Layout using named grid lines

  • grid-template-rows 및 grid-template-columns 속성으로 그리드를 정의할 때 그리드의 일부 또는 모든 라인에 이름을 지정할 수 있다.

* Line Naming (예시코드)

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

.grid {
  display: grid;
  gap: 10px;
  grid-template-columns: [first-line] 100px [second-line] 100px [third-line] 100px [fourth-line] 100px [fifth-line];
  grid-template-rows: repeat(4, 100px [row-line]);
}

.header {
  background-color: #2ecc71;
  grid-column: span 4;
}
.content {
  background-color: #3498db;
  grid-column: first-line / fourth-line;
  grid-row: row-line 1 / row-line 3;
}
.nav {
  background-color: #8e44ad;
  grid-row: span 2;
}
.footer {
  background-color: #f39c12;
  grid-column: span 4;
}

 

(참고) https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout/Layout_using_Named_Grid_Lines

(참고) flex는 1차원이다. column만 가지고 있다. 행은 없다.
(참고) grid는 2차원 layout이다. row, column을 가지고 있다.

 

* 별로 선호하지 않는 방식

'Study > HTML,CSS' 카테고리의 다른 글

[CSS_study] display : grid_5 place-items & place-content  (0) 2022.05.17
[CSS_study] display : grid_4 grid-template & fr (fraction)  (0) 2022.05.17
[CSS_study] display : grid_2 (grid-column)  (0) 2022.05.14
[CSS_study] display : grid  (0) 2022.05.13
[CSS_study] flex-basis (flex-shrink 와 flex-grow 를 위한 기본 세팅)  (0) 2022.05.13
    'Study/HTML,CSS' 카테고리의 다른 글
    • [CSS_study] display : grid_5 place-items & place-content
    • [CSS_study] display : grid_4 grid-template & fr (fraction)
    • [CSS_study] display : grid_2 (grid-column)
    • [CSS_study] display : grid
    갈푸라떼
    갈푸라떼

    티스토리툴바