🦁_21.11.15 TIL

BoriΒ·2021λ…„ 11μ›” 15일
1
post-thumbnail

21λ…„ 11μ›” 15일

μ˜λ―Έμ—†λŠ” κ°œν–‰μ„ μœ„ν•œ <br> μ‚¬μš©

  • κ°œλ°œμžλ§ˆλ‹€ 의견이 λ‹€λ₯΄λ‹€.
  • 의견 1 : λ‹¨μˆœνžˆ λ””μžμΈμ„ μœ„ν•œ <br> μ‚¬μš©μ€ μ§€μ–‘ν•œλ‹€.
  • 의견 2 : μ˜λ―Έμ—†λŠ” κ°œν–‰μ„ μœ„ν•œ 것이라면 μ˜λ―Έμ—†λŠ” νƒœκ·Έλ₯Ό μ‚¬μš©ν•΄λ„ λ¬΄λ°©ν•˜λ‹€.

λ””μ¦ˆλ‹ˆ ν”ŒλŸ¬μŠ€ ν™ˆνŽ˜μ΄μ§€ κ΅¬κ²½ν•˜κΈ°

  • flex둜 κ΅¬ν˜„
  • μ™Έκ΅­ 기업은float보닀 flexλ₯Ό 더 많이 μ‚¬μš©ν•˜λ‚˜μš”?
    => 확인 ν•„μš”!
    => μ™Έκ΅­ 기업은 λ²ˆμ—­ μž‘μ—… λ•Œλ¬Έμ— float을 μ‚¬μš©ν•  경우, 높이 κ°’μ΄λ‚˜ ν…μŠ€νŠΈ 길이 λ“± λ‹€λ₯Έ μ–Έμ–΄λ‘œ λ³€κ²½ μ‹œ UIκ°€ 깨지기 μ‰¬μšΈ 것 κ°™μ•„μ„œ flexλ₯Ό 많이 μ‚¬μš©ν•  것 κ°™λ‹€λŠ” 의견이 μžˆμ—ˆλ‹€.

πŸ“ CSS

πŸ“Ž font 적용 방법

참고링크

πŸ“Ž flex 보좩

21.11.08-TIL μ°Έκ³ 

πŸ“Ž Holy Grail Layout

  • μ„±λ°°(holy grail)λ₯Ό μ°ΎκΈ° μœ„ν•΄ λ§Žμ€ μ‚¬λžŒλ“€μ΄ λ…Έλ ₯ν–ˆλ˜ κ²ƒμ²˜λŸΌ Holy Grail Layout을 κ΅¬ν˜„ν•˜κΈ° μœ„ν•΄ λ§Žμ€ μ‚¬λžŒμ΄ λ…Έλ ₯ν–ˆμ§€λ§Œ μ™„λ²½ν•œ κ²°κ³Όλ₯Ό μ°ΎκΈ° λͺ»ν–ˆλ‹€λŠ” λΉ„μœ 

flexλ₯Ό μ΄μš©ν•œ Holy Grail Layout

  • HTML
<!DOCTYPE html>
<html lang="ko">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Holy Grail</title>
    <link
      href="https://fonts.googleapis.com/css2?family=Material+Icons+Outlined"
      rel="stylesheet"
    />

    <link rel="stylesheet" href="../reset.css" />
    <link rel="stylesheet" href="012.css" />
  </head>
  <body>
    <header>
      <h2 class="area-name">header</h2>
      <a href="#" class="logo">LOGO</a>
      <nav>
        <ul class="menu">
          <li><a href="#" class="link-menu">MENU1</a></li>
          <li><a href="#" class="link-menu">MENU2</a></li>
          <li><a href="#" class="link-menu">MENU3</a></li>
          <li><a href="#" class="link-menu">MENU4</a></li>
        </ul>
      </nav>
      <button class="btn-toggle">
        <span class="material-icons-outlined"> menu </span>
      </button>
    </header>
    <main>
      <section>
        <h2 class="area-name">section</h2>
        <article><h2 class="area-name">article</h2></article>
        <article><h2 class="area-name">article</h2></article>
        <article><h2 class="area-name">article</h2></article>
      </section>
      <aside>
        <h2 class="area-name">aside</h2>
      </aside>
    </main>
    <footer>
      <h2 class="area-name">footer</h2>
    </footer>
  </body>
</html>
  • CSS
@charset "utf-8";

body {
  display: flex;
  flex-direction: column;
}

header,
section,
aside,
footer {
  position: relative;
  padding: 30px 0;
}

.area-name {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  color: rgba(0, 0, 0, 0.5);
  font-size: 40px;
  font-weight: bold;
}

/* header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: khaki;
}

.logo {
  padding: 0 30px;
  font-size: 20px;
  font-weight: bold;
}

.menu {
  display: flex;
  padding-right: 20px;
}

.menu li {
  margin-left: 10px;
}

.menu .link-menu {
  padding: 5px 15px;
  border-radius: 30px;
  background-color: rgba(255, 255, 255, 0.6);
  font-weight: bold;
}

.btn-toggle {
  display: none;
  margin-right: 30px;
  padding: 10px 10px 8px;
  border: 0;
  background: none;
}

/* main */
main {
  display: flex;
  flex-wrap: wrap;
  min-height: 500px;
}

/* main > section */
section {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  flex: 4;
  padding: 30px;
  background-color: lemonchiffon;
}

article {
  position: relative;
  width: 48%;
  background-color: lightgreen;
}

article:nth-of-type(1) {
  width: 100%;
}

article + article {
  margin-top: 4%;
}

/* main > aside */
aside {
  flex: 1;
  background-color: lavender;
}

/* footer */
footer {
  min-height: 50px;
  background-color: lightcoral;
}

@media screen and (max-width: 800px) {
  .menu {
    display: none;
  }

  .btn-toggle {
    display: block;
  }

  main {
    flex-direction: column;
  }
  section {
    flex: 1;
  }

  aside {
    flex: 1;
  }
}


마무리

  • μ˜€λŠ˜μ€ 자꾸만 λ©ν•΄μ‘Œλ‹€. μ§€κΈˆλ„ 멍-
  • TILμž‘μ„±μ΄ 빨리 λλ‚˜λ‹ˆκΉŒ μ΄μƒν•˜λ„€?

1개의 λŒ“κΈ€

comment-user-thumbnail
2021λ…„ 11μ›” 15일

μƒˆ ν‘œμ§€κ°€ μƒκ²Όλ„€μš”!! λ„ˆλ¬΄ κ·€μ—¬μ›Œμš¬γ…‹γ…‹γ…‹γ…‹

λ‹΅κΈ€ 달기